Deploy ambient web client #29
Workflow file for this run
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: "deploy-web" | |
on: | |
pull_request: | |
branches: ["main"] | |
# push: | |
# branches: ["main"] | |
# tags: [v*] | |
# TODO: remove, only for testing | |
env: | |
PACKAGE_NAME: ambient-web-${{ github.sha }} | |
jobs: | |
build: | |
permissions: | |
id-token: write | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
target: wasm32-unknown-unknown | |
- name: "Build campfire" | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --package campfire | |
- name: "Build web client" | |
uses: actions-rs/cargo@v1 | |
with: | |
command: run | |
args: --package campfire -- web build --profile release --target standalone --pkg-name ${{ env.PACKAGE_NAME }} | |
- name: Upload package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ambient-web-standalone | |
path: ./web/pkg | |
- id: auth | |
name: Authenticate with Google Cloud | |
uses: google-github-actions/auth@v0 | |
with: | |
token_format: access_token | |
workload_identity_provider: projects/549180905870/locations/global/workloadIdentityPools/github-pool/providers/github-provider | |
service_account: [email protected] | |
access_token_lifetime: 1800s | |
- name: Upload to Google Cloud | |
uses: google-github-actions/upload-cloud-storage@v1 | |
with: | |
path: "./web/${{ env.PACKAGE_NAME }}" | |
destination: "ambient-artifacts/ambient-web-clients" | |
- name: Upload Canary to Google Cloud | |
uses: google-github-actions/upload-cloud-storage@v1 | |
with: | |
path: "./web/${{ env.PACKAGE_NAME }}" | |
destination: "ambient-artifacts/ambient-web-clients/ambient-canary" | |
parent: false | |