Skip to content

Commit 71f2003

Browse files
committed
Update build scripts
1 parent e99c711 commit 71f2003

3 files changed

Lines changed: 84 additions & 22 deletions

File tree

.github/workflows/build.yaml

Lines changed: 82 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,58 @@ on:
77
pull_request:
88
branches: [ master ]
99
workflow_dispatch:
10+
inputs:
11+
run_deploy:
12+
description: 'Should newest tag be deployed?'
13+
required: false
14+
default: ""
1015

1116

1217

1318
jobs:
14-
sphinx-build:
19+
20+
build-last-tagged:
21+
runs-on: ubuntu-latest
22+
if: "github.event.inputs.run_deploy"
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Checkout last tagged
30+
run: |
31+
git checkout $(git describe --tags `git rev-list --tags --max-count=1`);
32+
33+
- name: Setup conda
34+
uses: conda-incubator/setup-miniconda@v2
35+
with:
36+
activate-environment: sphinx
37+
environment-file: environment.yaml
38+
channels: conda-forge
39+
40+
- name: Build last tagged version
41+
shell: bash -l {0}
42+
run: |
43+
make clean
44+
make html
45+
46+
- name: Deploy 🚀
47+
if: github.ref == 'refs/heads/master'
48+
uses: peaceiris/actions-gh-pages@v3
49+
with:
50+
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
51+
external_repository: AnyBody/tutorials
52+
publish_branch: gh-pages
53+
publish_dir: _build/html
54+
55+
56+
sphinx-build-master:
1557
runs-on: ubuntu-latest
16-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
58+
if: "!github.event.inputs.run_deploy"
1759

1860
steps:
19-
- uses: actions/checkout@v2
61+
- uses: actions/checkout@v3
2062
with:
2163
fetch-depth: 0
2264

@@ -33,34 +75,54 @@ jobs:
3375
- name: Build Documentation
3476
shell: bash -l {0}
3577
run: |
36-
set -e
3778
make html-dev
38-
mkdir -p public/dev
39-
cp -rT _build/html public/dev
40-
41-
- name: Build last tagged version
79+
80+
- name: Deploy 🚀
4281
if: github.ref == 'refs/heads/master'
43-
shell: bash -l {0}
82+
uses: peaceiris/actions-gh-pages@v3
83+
with:
84+
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
85+
external_repository: AnyBody/tutorials
86+
publish_branch: gh-pages
87+
publish_dir: _build/html
88+
destination_dir: dev
89+
90+
91+
sphinx-build-new-theme:
92+
runs-on: ubuntu-latest
93+
if: "!github.event.inputs.run_deploy"
94+
95+
steps:
96+
- uses: actions/checkout@v3
97+
with:
98+
fetch-depth: 0
99+
100+
- name: Checkout new theme branch
44101
run: |
45-
git checkout $(git describe --tags `git rev-list --tags --max-count=1`);
46-
make clean
47-
make html
48-
cp -rT _build/html public
102+
git checkout newtheme
103+
104+
- name: Setup conda
105+
uses: conda-incubator/setup-miniconda@v2
106+
with:
107+
activate-environment: sphinx
108+
environment-file: environment.yaml
109+
channels: conda-forge
49110

50-
- name: Build new theme version
51-
if: github.ref == 'refs/heads/master'
111+
- uses: ammaraskar/sphinx-problem-matcher@master
112+
# if: github.ref != 'refs/heads/master'
113+
114+
- name: Build Documentation
52115
shell: bash -l {0}
53116
run: |
54-
git checkout newtheme;
55-
make clean
56117
make html-dev
57-
cp -rT _build/html public/new
58-
118+
59119
- name: Deploy 🚀
60120
if: github.ref == 'refs/heads/master'
61121
uses: peaceiris/actions-gh-pages@v3
62122
with:
63123
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
64124
external_repository: AnyBody/tutorials
65125
publish_branch: gh-pages
66-
publish_dir: ./public
126+
publish_dir: _build/html
127+
destination_dir: new
128+

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33

44
# You can set these variables from the command line.
5-
SPHINXOPTS = -W
5+
SPHINXOPTS =
66
SPHINXBUILD = python -msphinx
77
SPHINXPROJ = AnyBodyTutorials
88
SOURCEDIR = .

environment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.9
77
- pip
88
- sphinx
9-
- myst-parser
9+
- myst-parser<0.18
1010
- linkify-it-py
1111
- make
1212
- cloud_sptheme

0 commit comments

Comments
 (0)