Skip to content

Deploy

Deploy #7

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Check
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
strategy:
matrix:
command: [ lint, typecheck ]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Authorize Google Cloud SDK
id: auth
uses: google-github-actions/auth@v3
with:
create_credentials_file: true
project_id: ${{ secrets.GOOGLE_PROJECT_ID }}
workload_identity_provider: ${{ secrets.GOOGLE_PROJECT_WORKLOAD_IDENTITY_POOL_PROVIDER}}
- name: Update .npmrc
run: bunx google-artifactregistry-auth --credential-config .npmrc
- name: Install dependencies
run: bun install
- name: ${{ matrix.command }}
run: bun ${{ matrix.command }}
release:
name: Deploy
runs-on: ubuntu-latest
needs: [ check ]
permissions:
contents: 'write'
id-token: 'write'
issues: 'write'
pull-requests: 'write'
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Authorize Google Cloud SDK
id: auth
uses: google-github-actions/auth@v3
with:
create_credentials_file: true
project_id: ${{ secrets.GOOGLE_PROJECT_ID }}
workload_identity_provider: ${{ secrets.GOOGLE_PROJECT_WORKLOAD_IDENTITY_POOL_PROVIDER}}
- name: Update .npmrc
run: bunx google-artifactregistry-auth --credential-config .npmrc
- name: Install dependencies
run: bun install
- name: Build
run: 'bun run build'
- name: Configure Git User
run: |
git config --global user.email "github@mariomh.com"
git config --global user.name "$GITHUB_ACTOR"
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: pages deploy dist --project-name=terminal-mariomh