-
Notifications
You must be signed in to change notification settings - Fork 5
45 lines (43 loc) · 1.26 KB
/
push_docs_unstable.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
name: Horace user documentation update
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
doc_root: $GITHUB_WORKSPACE/documentation/user_docs
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Update dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install -r ${{ env.doc_root }}/requirements.txt
- name: Build and Commit
run: |
tmp_dir=$(mktemp -d -t pages-XXXXXXXXXX)
sphinx-build -b html ${{ env.doc_root }}/docs $tmp_dir
rm -rf $tmp_dir/.doctrees
cd $GITHUB_WORKSPACE
git checkout --force gh-pages
rm -rf unstable
cp -rpav $tmp_dir unstable
git add unstable
git config --global user.email "[email protected]"
git config --global user.name "Github Actions"
git commit --allow-empty -m "Add unstable changes for $GITHUB_SHA"
- name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages