-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (40 loc) · 1.25 KB
/
deploy-to-cloudflare-pages.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
name : Deploy to Cloudflare Pages
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
deployments: write
steps:
- uses: Kesin11/actions-timeline@v2
- uses: actions/checkout@v4
- run: |
rustup target add wasm32-unknown-unknown
rustup component add rust-src
- uses: Swatinem/rust-cache@v2
- name: Build
run: |
# ビルド時にカスタムプロファイルを使いたいのでwasm-packはlatestが必要
cargo install --git https://github.com/rustwasm/wasm-pack.git
- run: wasm-pack build --target web --profile release-wasm
- name: Gather artifacts
run: |
mkdir -p dist
cp -r pkg dist/
cp index.html dist/
cp img/ogp.png dist/
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist --project-name=spectre --commit-dirty=true
gitHubToken: ${{ secrets.GITHUB_TOKEN }}