-
Notifications
You must be signed in to change notification settings - Fork 36
79 lines (66 loc) · 2.17 KB
/
push.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
name: On main push
on:
push:
branches: [ "main" ]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/python@b98d498629f1c368650224d6d212bf7dfa89e4bf
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=high
command: monitor
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.8
id: setup-python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Copy main branch into gh-pages
run: |
git checkout gh-pages
git reset --hard main
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }}
- name: Install Poetry
run: pip install poetry
- name: Cache poetry
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-${{ steps.setup-python.outputs.python-version }}-
- name: Install Poetry deps
run: poetry install
- name: Generate Sphinx documentation
working-directory: ./docsrc
run: |
. `poetry env info --path`/bin/activate
make html
- name: Copy Sphinx documentation into docs/
working-directory: ./docsrc/_build/html
run: mv * $GITHUB_WORKSPACE/docs/
- name: Commit changes
run: |
git config user.name github-actions
git config user.email [email protected]
git add docs/
git commit -m "Generated commit for Sphinx documentation"
git push -f origin gh-pages