-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (44 loc) · 1.47 KB
/
docs_release.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
name: "Build release docs"
on:
release:
types: [ created ]
env:
VERSION_FILE: recipipe/_version.py
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Update version
run: |
# Get version numbers form GITHUB_REF (without the leading "v").
VERSION=$(sed -n 's/.*\/v\(.*\)/\1/p' <<< $GITHUB_REF)
# Substitute value in _version file.
sed -i "s/0.0.0/$VERSION/" $VERSION_FILE
# Save a version env variable to reuse it later (leading "v" included).
echo ::set-env name=RELEASE_VERSION::v$VERSION
- name: Install dependencies
run: |
sudo apt-get install graphviz
pip install -r requirements_dev.txt
- name: Generate pre-build data
run: |
cd doc/
make generate_data
- name: Build docs
run: |
cd doc/
make html
touch _build/html/.nojekyll # needed to deploy folders starting with "_" in gh-pages
- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages # the branch the action should deploy to.
FOLDER: doc/_build/html # the folder the action should deploy.
# Output folder where the docs are going to be saved.
TARGET_FOLDER: ${{ env.RELEASE_VERSION }}