-
Notifications
You must be signed in to change notification settings - Fork 51
41 lines (34 loc) · 1.19 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
name: Deploy Web Demo and Docs
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Build
run: make web
# Upload the built website as an artifact, so that runs which are not deployed
# (i.e. other branches and PRs) to Github Pages can be be downloaded
# (https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts)
# and viewed locally.
#
# When Github adds support for PR Github Pages previews
# (https://github.com/orgs/community/discussions/7730)
# this can be removed.
- name: Upload web artifact
uses: actions/upload-artifact@v3
with:
name: www
path: target/www
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
# only actually deploy if pushed to main branch
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/www
force_orphan: true