-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (38 loc) · 1.25 KB
/
Copy pathdeploy.yml
File metadata and controls
48 lines (38 loc) · 1.25 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
name: Deploy to Cloudflare Pages
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: pages-deploy-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
deployments: write
jobs:
deploy:
name: Build WASM and deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache cargo registry and target
uses: Swatinem/rust-cache@v2
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Install wasm-opt (binaryen)
run: |
sudo apt-get update
sudo apt-get install -y binaryen
- name: Build optimised WASM into web/
run: ./scripts/build_wasm.bash
- name: Publish to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy web --project-name=long-multiplication-calculator --branch=main --commit-dirty=true
gitHubToken: ${{ secrets.GITHUB_TOKEN }}