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 7, 2024
1 parent 7c8f1b2 commit ea7b39d
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/build_and_deploy_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow is triggered on any PR's changes

name: Build and deploy docs to Github Pages

on:
push:
branches:
- bugfix/FAIRSPC-87


jobs:
build-saturn:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Log details
run: |
BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
echo "Triggered on branch: $BRANCH"
- name: Set up Ruby (required for gem installation)
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'

- name: Install Asciidoctor
run: |
gem install asciidoctor
gem install asciidoctor-pdf
gem install rouge
- name: Run Build Docs script
run: ./docs/build.sh

- name: Run Deploy Docs script
run: ./docs/deploy.sh

3 changes: 2 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1900,7 +1900,8 @@ Multiple external Fairspace metadata pages can be configured simultaneously. A l
| String to be used as a display name of the metadata source.
| ``url``
| Fairspace instance to connect to. If the url is not specified, the metadata source will be treated as the internal one.
| *Important!* There should only be a single configuration of internal metadata (only the first one will not be ignored).

*Important!* There should only be a single configuration of internal metadata (only the first one will not be ignored).
| ``icon-name``
| Name of an icon configured in the "icons" section of values.yaml file. If the name is not specified, there will be a default icon used.
|===
Expand Down
18 changes: 18 additions & 0 deletions docs/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

cd ..
git clone "https://${CI_SERVICE_ACCOUNT_USER}:${CI_SERVICE_ACCOUNT_PASSWORD}@github.com/${DOCUMENTATION_REPO}" fairspace-docs
export DOCS_DIR=$(pwd)/fairspace-docs

cp -r ./fairspace/docs/build/* "${DOCS_DIR}/"

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
else
echo "Documentation unchanged."
fi
popd

0 comments on commit ea7b39d

Please sign in to comment.