-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (53 loc) · 2.16 KB
/
publish-docs.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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Publish Documentation
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
# This conditional ensures that forks on GitHub do not attempt to publish
# documentation, only the "upstream" one. (If forks _did_ try to publish
# they would fail later below because they would not have access to the
# secret credentials. But it's better to opt out here.)
if: github.repository_owner == 'vstadnytskyi'
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
fail-fast: false
steps:
- name: Set env.REPOSITORY_NAME # just the repo, as opposed to org/repo
shell: bash -l {0}
run: |
export REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}
echo "REPOSITORY_NAME=${REPOSITORY_NAME}" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
fetch-depth: 1000 # should be enough to reach the most recent tag
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install
shell: bash -l {0}
run: source continuous_integration/scripts/install.sh
- name: Install documentation-building requirements
shell: bash -l {0}
run: |
set -vxeuo pipefail
python -m pip install -r requirements-dev.txt
python -m pip list
- name: Build Docs
shell: bash -l {0}
run: make -C docs/ html
- name: Deploy documentation to icarus-nmr.io.
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
deploy_key: ${{ secrets.ACTIONS_DOCUMENTATION_DEPLOY_KEY }}
publish_branch: gh-pages
publish_dir: ./docs/build/html