-
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (75 loc) · 2.57 KB
/
wrangler-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
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: Cloudflare Workers Deployments
on:
push:
branches: [main]
jobs:
paths-filter:
runs-on: ubuntu-latest
outputs:
golinks-next: ${{ steps.filter.outputs.golinks-next }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
golinks-next:
- 'apps/golinks-v2/**'
golinks-next:
name: Deploy golinks-next to staging
environment:
name: golinks-next/staging
url: https://staging.go-next.andreijiroh.xyz/api/docs
runs-on: ubuntu-latest
needs: [paths-filter]
if: needs.paths-filter.outputs.golinks-next == 'true'
steps:
- uses: actions/checkout@v4
- uses: andreijiroh-dev/dotenvx-action@main
id: dotenvx
with:
key: ${{ secrets.DOTENV_PRIVATE_KEY_CI }}
path: .env.ci
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies and generate Prisma client code
run: |
yarn install
yarn workspace @andreijiroh-dev/golinks-rewrite prisma generate
- name: Deploy to Workers in staging
id: deploy
run: |
yarn workspace @andreijiroh-dev/golinks-rewrite deploy:stg
git rev-parse HEAD | yarn workspace @andreijiroh-dev/golinks-rewrite wrangler secret put GIT_DEPLOY_COMMIT --env staging
env:
CLOUDFLARE_API_TOKEN: ${{ steps.dotenvx.outputs.WRANGLER_DEPLOY_TOKEN }}
golinks-next-prod:
name: Deploy golinks-next to production
environment:
name: golinks-next/production
url: https://go.andreijiroh.xyz/api/docs
runs-on: ubuntu-latest
needs: [paths-filter, golinks-next]
if: needs.paths-filter.outputs.golinks-next == 'true'
steps:
- uses: actions/checkout@v4
- uses: andreijiroh-dev/dotenvx-action@main
id: dotenvx
with:
key: ${{ secrets.DOTENV_PRIVATE_KEY_CI }}
path: .env.ci
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies and generate Prisma client code
run: |
yarn install
yarn workspace @andreijiroh-dev/golinks-rewrite prisma generate
- name: Deploy to Workers in staging
id: deploy
run: |
yarn workspace @andreijiroh-dev/golinks-rewrite deploy:prod
git rev-parse HEAD | yarn workspace @andreijiroh-dev/golinks-rewrite wrangler secret put GIT_DEPLOY_COMMIT --env production
env:
CLOUDFLARE_API_TOKEN: ${{ steps.dotenvx.outputs.WRANGLER_DEPLOY_TOKEN }}