-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (37 loc) · 1.05 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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 }}