-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FAIRSPC-87: added workflow to Build and deploy docs to Github Pages a…
…nd fixed table in doc
- Loading branch information
1 parent
ea7b39d
commit b6baebd
Showing
4 changed files
with
116 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
# the script pulls the documentation repository, copies the built documentation to the repository, commits and pushes the changes | ||
# the documentation repository is configured to deploy the documentation to the GitHub Pages on push to the main branch | ||
set -e | ||
|
||
# Set working directory | ||
# Get the directory where the script is located | ||
here=$(dirname "${0}") | ||
echo "Script directory: ${here}" | ||
pwd | ||
# Move two levels up from the script's directory | ||
parent_dir=$(cd "${here}/../.." && pwd) | ||
pushd "${parent_dir}" | ||
echo "Working directory: ${parent_dir}" | ||
|
||
export DOCS_REPO="https://${CI_SERVICE_ACCOUNT_USER}:${CI_SERVICE_ACCOUNT_PASSWORD}@github.com/thehyve/${DOCUMENTATION_REPO}" | ||
echo "Cloning documentation repository ${DOCS_REPO} ..." | ||
pwd | ||
git clone --branch main "${DOCS_REPO}" fairspace-docs | ||
echo "Cloning done." | ||
pwd | ||
git config --global user.email "ci_fairspace@thehyve.nl" | ||
git config --global user.name "${CI_SERVICE_ACCOUNT_USER}" | ||
export DOCS_DIR=$(pwd)/fairspace-docs | ||
|
||
echo "Copying documentation to ${DOCS_DIR} ..." | ||
pwd | ||
ls | ||
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 documentation" | ||
git push "${DOCS_REPO}" main | ||
else | ||
echo "Documentation unchanged." | ||
fi | ||
popd |