-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (53 loc) · 1.57 KB
/
deploy.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#
# Build and deploy the documentation
#
name: Deploy
# Run on main branch only
on:
# uncomment 'pull_request' line to test the workflow in PR
# pull_request:
push:
branches:
- main
schedule:
# Run weekly at 00:00 on Sunday
- cron: '0 0 * * 0'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
deploy:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Micromamba
uses: mamba-org/[email protected]
with:
environment-file: environment.yml
cache-downloads: true
cache-environment: true
- uses: actions/cache@v3
id: cache
with:
path: |
_build/jupyter_execute/
key: caches
- name: Disable notebook cache for scheduled jobs
if: github.event_name == 'schedule'
run: |
sed -i"" 's/execute_notebooks: auto/execute_notebooks: force/' source/_config.yml
- name: Build documentation
run: make dirhtml
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/dirhtml
# Only keep the latest commit to avoid bloating the repository
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'