-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (48 loc) · 1.45 KB
/
sphinx-build.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
name: Sphinx Build
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags.
fetch-depth: '0'
- name: Install packages
run: |
sudo apt update
sudo apt upgrade -y
sudo apt install -y git make python3-pip
- name: Install Sphinx packages
run: pip install -r requirements.txt
- name: Build docs using Sphinx
run: |
make clean
make html
# Publish built docs to gh-pages branch.
# ===============================
- name: Commit documentation changes
run: |
rm -rf docs # not sure if this is needed...
mkdir docs
cp -rf build/html/* docs/
cd docs
echo "docs.amdc.dev" > CNAME
touch .nojekyll # need this due to "_*" dirs getting ignored by GitHub
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore that.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
force: true
directory: docs
github_token: ${{ secrets.GITHUB_TOKEN }}
# ===============================