-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (61 loc) · 2.06 KB
/
push-doc.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
on:
push:
branches:
- master
concurrency:
group: doc
cancel-in-progress: true
name: push-doc
jobs:
publish:
runs-on: ubuntu-latest
if: "
!endsWith(github.event.head_commit.message, '!minor')
&& !endsWith(github.event.head_commit.message, '!wip')
&& !endsWith(github.event.head_commit.message, '!WIP')
&& !startsWith(github.event.head_commit.message, 'test')
"
strategy:
matrix:
python-version: [ 3.9 ]
steps:
- name: Set envvars
run: |
repo_name=$(echo ${{ github.repository }} | sed "s/${{ github.repository_owner }}\///g")
echo "Repo name is $repo_name"
echo "REPO_NAME=$repo_name" >> $GITHUB_ENV
- uses: actions/checkout@master
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
ref: ${{ github.head_ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
- name: build
run: |
python -m pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager .
- name: make doc
run: |
pip install --upgrade --upgrade-strategy eager pdoc3
pdoc --html ${{ env.REPO_NAME }} -o docs
mv docs/${{ env.REPO_NAME }}/* docs/
rm -r docs/${{ env.REPO_NAME }}
- name: commit doc
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "docs"
- name: Push doc
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.ORG_TOKEN_CICD }}
branch: "gh-pages"
force: true