Skip to content

Commit

Permalink
FAIRSPC-87: added workflow to Build and deploy docs to Github Pages a…
Browse files Browse the repository at this point in the history
…nd fixed table in doc
  • Loading branch information
tgreenwood committed Jun 10, 2024
1 parent ea7b39d commit 188c85a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build_and_deploy_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,9 @@ jobs:
run: ./docs/build.sh

- name: Run Deploy Docs script
env:
CI_SERVICE_ACCOUNT_USER: ${{ secrets.CI_SERVICE_ACCOUNT_USER }}
CI_SERVICE_ACCOUNT_PASSWORD: ${{ secrets.FNS_PAT }}
DOCUMENTATION_REPO: ${{ vars.DOCUMENTATION_REPO }}
run: ./docs/deploy.sh

1 change: 1 addition & 0 deletions docs/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e

PROJECT_FILES=(
"projects/saturn/src/main/resources/log4j2.properties"
Expand Down
11 changes: 8 additions & 3 deletions docs/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/usr/bin/env bash
set -e

cd ..
git clone "https://${CI_SERVICE_ACCOUNT_USER}:${CI_SERVICE_ACCOUNT_PASSWORD}@github.com/${DOCUMENTATION_REPO}" fairspace-docs
export DOCS_REPO="https://${CI_SERVICE_ACCOUNT_USER}:${CI_SERVICE_ACCOUNT_PASSWORD}@github.com/thehyve/${DOCUMENTATION_REPO}"
echo "Cloning documentation repository ${DOCS_REPO} ..."
git clone --branch main "${DOCS_REPO}" fairspace-docs
git config --global user.email "ci_fairspace@thehyve.nl"
git config --global user.name "${CI_SERVICE_ACCOUNT_USER}"
export DOCS_DIR=$(pwd)/fairspace-docs

cp -r ./fairspace/docs/build/* "${DOCS_DIR}/"
Expand All @@ -10,8 +15,8 @@ pushd "${DOCS_DIR}"
if [ ! "$(git status -s)" == "" ]; then
echo "Committing changes to ${DOCUMENTATION_REPO} ..."
git add .
git commit -a -m "Update from the documentation branch of ${TRAVIS_REPO_SLUG}."
git push "https://${GITHUB_USERNAME}:${GITHUB_PASSWORD}@github.com/${DOCUMENTATION_REPO}" main
git commit -a -m "Update documentation"
git push "${DOCS_REPO}" main
else
echo "Documentation unchanged."
fi
Expand Down

0 comments on commit 188c85a

Please sign in to comment.