-
Notifications
You must be signed in to change notification settings - Fork 116
57 lines (54 loc) · 2.03 KB
/
build_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
name: Build documentation
# Run workflow on pushes to matching branches
on:
push:
branches: [main]
# checkout needs 'contents:read'
# deploy needs 'contents:write'
permissions:
contents: write
jobs:
build_docs:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup SSH keys
if: ${{ !env.ACT }}
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Install apt packages
run: sudo apt-get update && sudo apt-get -y install ffmpeg texlive-latex-base texlive-latex-extra
- name: Install Python packages
run: pip install -r requirements.txt
- name: Configure git user
shell: bash
run: |
git config --global user.name "Turing Developer"
git config --global user.email "[email protected]"
git config --global pull.rebase false
# Remove git http extraheader arguments as these conflict with the use of SSH keys
- name: Remove git http extraheader arguments
if: ${{ !env.ACT }}
shell: bash
run: |
git config --list | grep "^http.*extraheader" | cut -d '=' -f 1 | xargs -L1 git config --unset-all
git --no-pager config --list
- name: Build latest documentation
shell: bash
run: ./build_docs.sh
- name: Deploy documentation to GitHub Pages
if: ${{ !env.ACT }}
uses: JamesIves/github-pages-deploy-action@5dc1d5a192aeb5ab5b7d5a77b7d36aea4a7f5c92 # This is version 4.1.4
with:
branch: gh-pages # The branch the action should deploy to.
folder: _build # The folder the action should deploy.
git-config-name: Deployment Bot # Name of the committer
git-config-email: [email protected] # Email of the committer