Deploy to Prod #247
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 to Prod | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Choose an environment to deploy to: <prod> ' | |
required: true | |
default: 'prod' | |
env: | |
BUILD_ENVIRONMENT: ${{ github.event.inputs.environment }} | |
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
KV_LOCAL_ID: ${{ secrets.KV_LOCAL_ID }} | |
KV_PROD_ID: ${{ secrets.KV_PROD_ID }} | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: ${{ github.event.inputs.environment }} | |
name: Deploy | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Build & Test | |
run: | | |
yarn | |
yarn run build | |
yarn run test | |
- name: Publish | |
uses: cloudflare/[email protected] | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
preCommands: yarn build | |
command: publish --env ${{ github.event.inputs.environment }} | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |