Compare commits

...

11 Commits

Author SHA1 Message Date
mfahampshire f398801d8e changed order of book building.. 2024-04-25 17:56:05 +02:00
mfahampshire 4a55af3886 fixed broken /dist/docs/ path 2024-04-25 17:53:10 +02:00
mfahampshire 5a2c708120 reintroduced another book 2024-04-25 17:45:58 +02:00
mfahampshire 7cff6193a2 fix .sh to get version command to work properly 2024-04-25 17:41:55 +02:00
mfahampshire 02db41f450 made mdbook version to .y.z 2024-04-25 17:36:46 +02:00
mfahampshire 75a65a46c4 changed only build target to devportal 2024-04-25 17:32:54 +02:00
mfahampshire 2301e002a8 revert to specific server name 2024-04-25 17:23:43 +02:00
mfahampshire c988d0ff05 only build operators + info logging 2024-04-25 16:58:30 +02:00
mfahampshire b2679e99a6 update runner naming 2024-04-25 16:46:30 +02:00
mfahampshire 60905c1b1b remove devportal 2024-04-25 16:35:02 +02:00
mfahampshire 1cfbc1d64a test 2024-04-25 16:10:44 +02:00
3 changed files with 8 additions and 52 deletions
+2 -18
View File
@@ -9,7 +9,7 @@ on:
jobs:
build:
runs-on: ubuntu-20.04-16-core
runs-on: ubuntu-22.04-16-core
steps:
- uses: actions/checkout@v3
- name: Install Dependencies (Linux)
@@ -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
+4 -32
View File
@@ -1,15 +1,11 @@
#!/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.
# array of project dirs
declare -a projects=("docs" "dev-portal" "operators")
declare -a projects=("dev-portal" "docs" "operators")
# check you're calling from the right place
if [ $(pwd | awk -F/ '{print $NF}') != "documentation" ]
@@ -18,34 +14,10 @@ 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 ../
echo $i &&
cd "./$i" && RUST_LOG=info mdbook build --dest-dir ../../dist/docs/$i/ && cd ../
done
# rename for server paths
rm -rf ../dist/docs/developers
rm -rf ../dist/developers
mv ../dist/docs/dev-portal ../dist/docs/developers
fi
+2 -2
View File
@@ -7,7 +7,7 @@ set -o pipefail
# simple script to automate cleaning an existing mdbook install then installing it fresh for each deploy.
# pinning minor version allows for updates but no breaking changes
MINOR_VERSION=0.4
MINOR_VERSION=0.4.36
# if a new plugin is added to the books it needs to be added here also
declare -a plugins=("admonish" "linkcheck" "last-changed" "theme" "variables" "cmdrun")
@@ -16,7 +16,7 @@ install_mdbook_deps() {
printf "\ninstalling mdbook..."
# installing mdbook with only specific features for speed
# cargo install mdbook --no-default-features --features search --vers "^$MINOR_VERSION"
cargo install mdbook --vers "^$MINOR_VERSION"
cargo install mdbook --vers $MINOR_VERSION
printf "\ninstalling plugins..."
for i in "${plugins[@]}"