-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (26 loc) · 839 Bytes
/
deploy-backend.yml
File metadata and controls
30 lines (26 loc) · 839 Bytes
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
name: Deploy Cloudflare Worker
# 1. When should the robot run?
on:
push:
branches:
- main # Only run when code is pushed to the main branch
paths:
- 'backend/**' # ONLY run if a file inside the 'backend' folder was changed
# 2. What should the robot do?
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy Worker
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Dependencies
working-directory: backend
run: npm ci
- name: Deploy to Cloudflare
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
workingDirectory: 'backend' # Tells it where to find wrangler.toml
command: deploy --env production