Skip to content

Deploy Client

Deploy Client #41

Workflow file for this run

name: Deploy Client
on:
push:
branches:
- main
paths:
- 'client/**'
- '.github/workflows/client.yml'
workflow_dispatch:
inputs:
environment:
type: environment
description: Choose an environment to deploy to
jobs:
deploy:
defaults:
run:
working-directory: ./client
runs-on: ubuntu-latest
env:
DEPLOYMENT_ENV: ${{ inputs.environment == 'Production' && 'prod' || 'dev' }}
environment: ${{ inputs.environment == 'Production' && 'Production' || 'Development' }}
name: Deploy
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Install Dependencies
run: pnpm install
- name: Build
run: pnpm build
env:
VITE_API_URL: https://openvote-api-${{ env.DEPLOYMENT_ENV }}.drub.workers.dev
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
workingDirectory: './client'
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
environment: ${{ env.DEPLOYMENT_ENV }}