Web Deploy #10
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: Web Deploy | |
on: workflow_dispatch | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
deploy: | |
name: Deploy to Firebase | |
runs-on: windows-latest # purely preference, could work on linux hosts | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
cache-dependency-path: ./web/package-lock.json | |
- name: Sanity Build/Testing | |
run: cargo test --verbose | |
- name: Install Build tools for Web Deploy | |
working-directory: ./web | |
run: npm ci | |
- name: WASM Build | |
working-directory: ./web | |
run: npx wasm-pack build ".." --target web --out-name web --out-dir web/pkg | |
- name: Webpack Build | |
working-directory: ./web | |
run: npm run build | |
- uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
command: pages deploy out --project-name=${{ secrets.CLOUDFLARE_PROJECT_NAME }} |