-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (50 loc) · 1.49 KB
/
deploy-pages.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
name: Deploy
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: "**/requirements*.txt"
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "gh-pages-rust"
- name: Build GitHub Pages
working-directory: crates/wgpy_pyo3
run: |
rustup update
sudo apt install pandoc -y
pip install -r requirements-dev.txt
maturin build --out dist --find-interpreter
pip install webgpupy --find-links dist --force-reinstall
sphinx-build -b html docs/source/ docs/build/html
- name: Deploy GitHub Pages
if: ${{ github.event_name == 'push' }}
working-directory: crates/wgpy_pyo3
run: |
git worktree add gh-pages
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
# Delete the ref to avoid keeping history.
git update-ref -d refs/heads/gh-pages
rm -rf *
mv ../docs/build/html/* .
mv ../docs/build/html/.[A-Za-z0-9]* .
git add .
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force --set-upstream origin gh-pages