-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (47 loc) · 1.44 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
#
# 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/setup-micromamba@v1.5.0
with:
environment-file: environment.yml
cache-downloads: true
cache-environment: true
- 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'