-
-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (35 loc) · 1.1 KB
/
deploy-to-cf.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
41
42
43
name: Deploy to Cloudflare Workers
on: [push, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-and-deploy:
runs-on: ubuntu-latest
name: Test and deploy
steps:
- name: Checkout 🧳
uses: actions/checkout@v4
- name: Setup PNPM ⚙️
uses: AkashRajpurohit/.github/.github/actions/setup-pnpm@main
with:
node_version: 20
pnpm_version: 9
- name: Install dependencies ⏬
run: pnpm install --no-frozen-lockfile
# Run tests
- name: Run tests 🫡
run: yarn test
- name: Upload Test Results ⏫
uses: actions/upload-artifact@v4
with:
name: coverage
path: .coverage/
# Deploy
- name: Deploy 🚀
# Deploy only when code is pushed to main branch
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: yarn deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}