Build and deploy to Cloudflare Pages #68
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
name: Build and deploy to Cloudflare Pages | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
deployments: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hecrj/setup-rust-action@v2 | |
with: | |
rust-version: stable | |
- name: Install Trunk | |
run: cargo install trunk | |
- name: Add the WASM build target | |
run: rustup target add wasm32-unknown-unknown | |
- name: Build the app | |
run: trunk build --release | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUND_ID }} | |
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }} | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
wranglerVersion: '3' | |
directory: dist |