forked from nexusformat/definitions
-
Notifications
You must be signed in to change notification settings - Fork 8
58 lines (55 loc) · 1.7 KB
/
fairmat-build-pages.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
name: GH pages fairmat proposal
on:
push:
branches: [fairmat]
pull_request:
branches: [fairmat]
jobs:
pages:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: install dependencies
run: pip install -r requirements.txt
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7
- name: test
run: make test
- name: prepare
run: make prepare
- name: html
run: make html
- name: Remove build artifacts
run: rm -rf build/manual/build/html/.doctrees build/manual/build/html/_sources
- name: Checkout fairmat-docs branch
run: |
git fetch origin fairmat-docs
git checkout fairmat-docs || git checkout --orphan fairmat-docs
- name: Move default branch build into fairmat-docs
if: steps.branch-name.outputs.is_default == 'true'
run: |
mkdir -p docs
cp -r build/manual/build/html/* docs
rm -R build/manual/build/html/*
- name: Move PR build into fairmat-docs
if: steps.branch-name.outputs.is_default == 'false'
run: |
mkdir -p docs/${{ steps.branch-name.outputs.current_branch }}
cp -r build/manual/build/html/* docs/${{ steps.branch-name.outputs.current_branch }}
rm -R build/manual/build/html/*
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs
publish_branch: fairmat-docs
destination_dir: docs
force_orphan: true