This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
generated from ApeWorX/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 12
60 lines (51 loc) · 1.86 KB
/
docs.yaml
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
name: Docs
on:
push:
branches: [main]
release:
types: [released]
pull_request:
types: [opened, synchronize]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
# TODO: Remove once we have re-added Myst-Parser to setup.py (post sphinx 6 support)
pip install git+https://github.com/executablebooks/MyST-Parser.git
pip install .[docs]
- name: Build HTML artifact
run: python build_docs.py
- name: Upload HTML artifact
uses: actions/upload-artifact@v1
with:
name: DocumentationHTML
path: docs/_build/ape-starknet
- name: Commit and publish documentation changes to gh-pages branch
run: |
if [[ "${GITHUB_EVENT_NAME}" =~ "pull_request" ]]; then
echo "skipping 'git commit' step for PR"
else
git clone https://github.com/${GITHUB_REPOSITORY} --branch gh-pages --single-branch gh-pages
cp -r docs/_build/ape-starknet/* gh-pages/
cd gh-pages
touch .nojekyll
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
fi
- name: Push changes
uses: ad-m/github-push-action@master
if: ${{ github.event_name != 'pull_request' }}
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}