-
Notifications
You must be signed in to change notification settings - Fork 9
40 lines (38 loc) · 1.46 KB
/
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
name: "Build Homepage"
on: [push, pull_request]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
# PDF
- uses: ax3l/sphinx-action@newer-sphinx
with:
docs-folder: "docs/"
pre-build-command: "apt-get update -y && apt-get install -y $(cat docs/ubuntu-package.list) && python -m pip install -r docs/requirements.txt"
build-command: "make latexpdf"
# HTML
- uses: ax3l/sphinx-action@newer-sphinx
with:
docs-folder: "docs/"
# Publish
- name: Commit Changes
if: github.event_name == 'push' && github.ref == 'refs/heads/latest'
run: |
git clone https://github.com/snowmass-compf2-accbeammodel/snowmass-compf2-accbeammodel.github.io.git --branch master --single-branch master
cp -r docs/build/html/* master/
cp -r docs/build/latex/SM2021_COMPF2_AccBeamModel.pdf master/_static/
cd master
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update homepage" -a || true
# The above command will fail if no changes were present, so we ignore
# the return code.
- name: Publish changes
if: github.event_name == 'push' && github.ref == 'refs/heads/latest'
uses: ad-m/github-push-action@master
with:
branch: master
directory: master
github_token: ${{ secrets.GITHUB_TOKEN }}