Website CI #1261
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 Github Actions Workflow checks out the latest version of the BioDynaMo | |
# master branch and builds the website biodynamo.org with the build target `website`. | |
# Internally it relies on the Gatsby framework to generate the static files | |
name: Website CI | |
on: | |
schedule: | |
# Every day at 3 am | |
- cron: '0 3 * * *' | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
tags: | |
description: 'Test scenario tags' | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y doxygen graphviz make | |
curl -L -O https://github.com/Kitware/CMake/releases/download/v3.19.3/cmake-3.19.3-Linux-x86_64.sh | |
chmod +x cmake-3.19.3-Linux-x86_64.sh | |
sudo ./cmake-3.19.3-Linux-x86_64.sh --skip-license --prefix=/usr/local | |
- name: Set OSVERS | |
run: echo "OSVERS=$(lsb_release -si)-$(lsb_release -sr)" >> $GITHUB_ENV | |
- name: Cache pyenv | |
uses: actions/cache@v2 | |
id: pyenv-cache | |
with: | |
path: ~/.pyenv | |
key: ${{ env.OSVERS }}-pyenv-3.9 | |
- name: Install pyenv dependency | |
if: steps.pyenv-cache.outputs.cache-hit != 'true' | |
run: | | |
curl https://pyenv.run | bash | |
export PATH="$HOME/.pyenv/bin:$PATH" | |
eval "$(pyenv init -)" | |
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.9.1 | |
pyenv shell 3.9.1 | |
- name: Checkout BioDynaMo | |
uses: actions/checkout@v2 | |
with: | |
repository: BioDynaMo/biodynamo | |
fetch-depth: 0 | |
path: biodynamo | |
- name: Cache Third Party Packages | |
uses: actions/cache@v2 | |
with: | |
path: biodynamo/build/third_party | |
key: ${{ env.OSVERS }}-third-party-${{ hashFiles('biodynamo/cmake/external/SHA256Digests.cmake') }} | |
- name: Install prerequisites | |
shell: bash | |
run: | | |
biodynamo/util/installation/ubuntu-20.04/prerequisites.sh all | |
- name: Build biodynamo.org | |
working-directory: biodynamo | |
shell: bash | |
run: | | |
export PATH="$HOME/.pyenv/bin:$PATH" | |
eval "$(pyenv init --path)" | |
eval "$(pyenv init -)" | |
pyenv shell 3.9.1 | |
pip install lxml_html_clean | |
cmake \ | |
-Dwebsite=on \ | |
-Dtest=off \ | |
-Dnotebooks=on \ | |
-Dnuma=off \ | |
-B build | |
cd build | |
make | |
make website | |
# Get a copy of the .github folder | |
- name: Checkout biodynamo.github.io | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
path: biodynamo.github.io | |
# Since the deploy step below deletes all website files first, before adding | |
# the updated files, it will also delete the .github folder | |
# We copy the .github folder to the publish_dir, so that it will be re-added | |
# once we deploy | |
- name: Copy .github folder | |
run: cp -R biodynamo.github.io/.github biodynamo/build/website/public | |
- name: Deploy biodynamo.org | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
publish_branch: master | |
user_name: 'github-actions[bot]' | |
user_email: '[email protected]' | |
publish_dir: biodynamo/build/website/public | |
exclude_assets: '' |