Skip to content

Commit

Permalink
GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
necocen committed Jan 20, 2025
1 parent ebd410d commit 5501547
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/deploy-to-cloudflare-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 }}
File renamed without changes

0 comments on commit 5501547

Please sign in to comment.