-
Notifications
You must be signed in to change notification settings - Fork 84
51 lines (48 loc) · 1.26 KB
/
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
name: Documentation
on:
push:
paths:
- 'docs/**'
branches:
- main
pull_request:
paths:
- 'docs/**'
branches:
- main
jobs:
"Build":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
cache: 'pip'
- run: pip install -r docs/requirements.txt
- run: make html
working-directory: docs
- uses: actions/upload-artifact@v3
with:
path: docs/_build/html
"Deploy":
needs: "Build"
if: success() && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: refs/heads/gh-pages
# Remove all tracked files such that we're left with a snapshot of the artifact.
- name: clean
run: git ls-files -z | xargs -0 rm -f
- uses: actions/download-artifact@v3
- name: commit
run: |
rsync -a artifact/ .
rm -rf artifact
git add -A
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git commit --allow-empty -m "Snapshot of $GITHUB_SHA"
- name: push
run: git push origin gh-pages