This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
96 lines (76 loc) · 2.3 KB
/
build.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build Tutorials
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
run_deploy:
description: 'Should newest tag be deployed?'
required: false
default: ""
jobs:
build-official-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout last tagged
if: "github.event.inputs.run_deploy"
run: |
git checkout $(git describe --tags `git rev-list --tags --max-count=1`);
- name: Setup conda
if: "github.event.inputs.run_deploy"
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: sphinx
environment-file: environment.yaml
channels: conda-forge
- name: Build last tagged version
if: "github.event.inputs.run_deploy"
shell: bash -l {0}
run: |
make clean
make html O="-W"
- name: Deploy 🚀
if: "github.event.inputs.run_deploy"
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: AnyBody/tutorials
publish_branch: gh-pages
publish_dir: _build/html
sphinx-build:
runs-on: ubuntu-latest
needs: [build-official-version]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: sphinx
environment-file: environment.yaml
channels: conda-forge
- uses: ammaraskar/sphinx-problem-matcher@master
# if: github.ref != 'refs/heads/master'
- name: Build Documentation
shell: bash -l {0}
run: |
make html O="-W"
- name: Check links
shell: bash -l {0}
run: |
make linkcheck
- name: Deploy 🚀
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: AnyBody/tutorials
publish_branch: gh-pages
publish_dir: _build/html
destination_dir: dev