-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (29 loc) · 969 Bytes
/
deploy-workers.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
name: Deploy Workers
on:
push:
branches: [main]
paths: ["functions/**"]
workflow_dispatch:
jobs:
deploy-functions:
# This job deploys the functions to Cloudflare Workers
# should only be run on pushes to functions/ directory in main branch
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
cache-dependency-path: functions/package-lock.json
- name: Install Dependencies
working-directory: ./functions
run: |
npm ci
- name: Deploy
working-directory: ./functions
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: npm run deploy