-
-
Notifications
You must be signed in to change notification settings - Fork 26
54 lines (45 loc) · 1.4 KB
/
docs.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
name: Build documentation
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-docs:
runs-on: ubuntu-latest
name: Build documentation
# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Pixi Environment
uses: prefix-dev/[email protected]
with:
pixi-version: latest
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Build docs
run: pixi run build-docs
- name: Deploy website
if: github.ref_name == 'main'
uses: peaceiris/actions-gh-pages@v4
with:
# https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-set-personal-access-token-personal_token
personal_token: ${{ secrets.GHPAGES_DEPLOY_KEY }}
publish_dir: ./site
publish_branch: gh-pages
allow_empty_commit: false
keep_files: false
force_orphan: true
enable_jekyll: false
- name: Deploy PR Preview
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main'
uses: rossjrw/[email protected]
with:
source-dir: ./site
preview-branch: gh-pages