-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 2.15 KB
/
Copy pathrelease.yml
File metadata and controls
77 lines (64 loc) · 2.15 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Release to Production
on:
push:
tags:
- 'v*' # triggers on v2.1.0, v2.2.0, etc.
jobs:
deploy-worker-production:
runs-on: ubuntu-latest
name: Deploy Worker (production)
steps:
- uses: actions/checkout@v4
with:
# Fetch full history so we can resolve which branch the tag is on
fetch-depth: 0
# Check out master explicitly — tag pushes otherwise leave the
# repo in detached HEAD, which Cloudflare Pages sees as "HEAD"
# instead of "master" and fails the production branch check.
ref: master
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install worker deps
working-directory: worker
run: npm install
- name: Type-check worker
working-directory: worker
run: npm run type-check
- name: Deploy Worker
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: worker
command: deploy # default env = production
deploy-frontend-production:
runs-on: ubuntu-latest
name: Deploy Frontend (production)
needs: deploy-worker-production
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install frontend deps
run: npm install
- name: Type-check frontend
run: npm run type-check
- name: Build frontend
run: npm run build
env:
VITE_API_URL: ${{ secrets.VITE_API_URL }}
- name: Deploy to Cloudflare Pages (production)
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist --project-name=vibecoded-stocard --branch=master
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true