-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.34 KB
/
Copy pathdeploy.yml
File metadata and controls
60 lines (49 loc) · 1.34 KB
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
name: Deploy Rust WASM Synthesizer to GitHub Pages
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build WASM
run: |
wasm-pack build --target web --out-dir pkg --out-name synthesizer
- name: Prepare deployment directory
run: |
mkdir -p deploy
cp index.html deploy/
cp -r pkg/ deploy/
cp -r assets/ deploy/ || true
- name: Create .nojekyll file
run: touch deploy/.nojekyll
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: deploy/
retention-days: 30
- name: Deploy GitHub Pages site
id: deployment
uses: actions/deploy-pages@v4