diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index a6d3c4a0b6..f30bb48bba 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -35,25 +35,9 @@ jobs: 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 & switch to b332a6b55668f60988e36961f3f62a794ba82ddb - run: git pull && git checkout b332a6b55668f60988e36961f3f62a794ba82ddb - - name: Build all projects in documentation/ & move to ~/dist/docs/ from b332a6b55668f60988e36961f3f62a794ba82ddb + - name: Build all projects in documentation/ & move to ~/dist/docs/ 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: Deploy branch to CI www continue-on-error: true uses: easingthemes/ssh-deploy@main diff --git a/documentation/build_all_to_dist.sh b/documentation/build_all_to_dist.sh index 63833c4359..90f8db0233 100755 --- a/documentation/build_all_to_dist.sh +++ b/documentation/build_all_to_dist.sh @@ -1,9 +1,5 @@ #!/usr/bin/env bash -set -o errexit -set -o nounset -set -o pipefail - # this is a script called by the github CI and CD workflows to build all 3 docs projects # and move them to /dist/ in the root of the monorepo. They are rsynced to various servers # from there by subsequent workflow tasks. @@ -18,34 +14,9 @@ then else for i in "${projects[@]}" do - # cd to project dir - cd "./$i" && - # little sanity checks - echo $(pwd) && echo $(mdbook --version) && - # clean old book - echo "cleaning old book" - rm -rf ./book/ - # build book - # mdbook test || true - mdbook build - # check for destination, if ! then mkdir & check again else echo thumbs up - if [ ! -d ../../dist/docs/$i ]; then - echo "dest doesn't exist: creating dir" - mkdir -p ../../dist/docs/$i - fi - if [ -d ../../dist/docs/$i ]; then - echo "cp destination exists, all good" - fi - # clean old dist/$i - rm -rf ../../dist/docs/$i - # move newly rendered book/ to dist - rsync -r ./book/html/ ../../dist/docs/$i - # sanity check - ls -laF ../../dist/docs/ - # cd back to ../documentation/ - cd ../ + cd "./$i" && mdbook build --dest-dir ../../dist/$i/ && cd ../ done # rename for server paths - rm -rf ../dist/docs/developers - mv ../dist/docs/dev-portal ../dist/docs/developers + rm -rf ../dist/developers + mv ../dist/dev-portal ../dist/developers fi