-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (97 loc) · 3.28 KB
/
website-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# 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: ''