Skip to content

Build and deploy to Cloudflare Pages #68

Build and deploy to Cloudflare Pages

Build and deploy to Cloudflare Pages #68

Workflow file for this run

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