-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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