From 5d3fa6d211ef599ee5ccfaf9fd884fd566e9a023 Mon Sep 17 00:00:00 2001 From: mfahampshire Date: Tue, 29 Oct 2024 18:12:51 +0100 Subject: [PATCH] updated ci/cd for docs --- .github/workflows/cd-docs.yml | 9 ++++----- .github/workflows/ci-docs.yml | 35 +++++++++-------------------------- 2 files changed, 13 insertions(+), 31 deletions(-) diff --git a/.github/workflows/cd-docs.yml b/.github/workflows/cd-docs.yml index faa0e21f90..52c88f06cb 100644 --- a/.github/workflows/cd-docs.yml +++ b/.github/workflows/cd-docs.yml @@ -30,13 +30,12 @@ jobs: command: build args: --workspace --release - - name: Install + - name: Install project dependencies run: pnpm i - - name: Build + - name: Build project run: pnpm run build - # todo - # - name: move static to /dist/ - # run: ./build_all_to_dist.sh + - name: Move files to /dist/ + run: ./scripts/move-to-dist.sh - name: Create Vercel project file uses: mobiledevops/secret-to-file-action@v1 diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 602df75b44..aa10fd5775 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -5,8 +5,8 @@ on: push: branches-ignore: master paths: - - 'documentation/docs/**' - - '.github/workflows/ci-docs.yml' + - "documentation/docs/**" + - ".github/workflows/ci-docs.yml" jobs: build: @@ -16,7 +16,7 @@ jobs: - name: Install Dependencies (Linux) run: sudo apt-get update && sudo apt-get install -y build-essential curl wget libssl-dev libudev-dev squashfs-tools protobuf-compiler git python3 && sudo apt-get update --fix-missing - name: Install pip3 - run: sudo apt install -y python3-pip + run: sudo apt install -y python3-pip - name: Install Python3 modules run: sudo pip3 install pandas tabulate - name: Install rsync @@ -34,30 +34,13 @@ jobs: with: command: build args: --workspace --release - - name: Install mdbook and plugins - run: cd documentation && ./install_mdbook_deps.sh - - name: Remove existing Nym config directory (`~/.nym/`) - run: cd documentation && ./remove_existing_config.sh - continue-on-error: false -# This is the original flow -# - name: Build all projects in documentation/ & move to ~/dist/docs/ -# run: cd documentation && ./build_all_to_dist.sh - -# This is a workaround replacement which builds on the last working commit b332a6b55668f60988e36961f3f62a794ba82ddb and then on current branch - - name: Save current branch to ~/current_branch - run: git rev-parse --abbrev-ref HEAD > ~/current_branch - - name: Git pull, reset & switch to b332a6b55668f60988e36961f3f62a794ba82ddb - run: git pull && git reset --hard && git checkout b332a6b55668f60988e36961f3f62a794ba82ddb - - name: Build all projects in documentation/ & move to ~/dist/docs/ from b332a6b55668f60988e36961f3f62a794ba82ddb - run: cd documentation && ./build_all_to_dist.sh - - - name: Switch to current branch - run: git checkout $echo "$(cat ~/current_branch)" - - name: Build all projects in documentation/ & move to ~/dist/docs/ on current branch - run: cd documentation && ./build_all_to_dist.sh && rm ~/current_branch - -# End of replacemet + - name: Install project dependencies + run: pnpm i + - name: Build project + run: pnpm run build + - name: Move files to /dist/ + run: ./scripts/move-to-dist.sh - name: Deploy branch to CI www continue-on-error: true