generated from PhilDL/react-router-gospel-stack
-
Notifications
You must be signed in to change notification settings - Fork 4
97 lines (94 loc) · 2.81 KB
/
proxy.yml
File metadata and controls
97 lines (94 loc) · 2.81 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: 🚀 Deploy Proxy
on:
push:
paths:
- "apps/proxy/**"
- "packages/internal-logs/**"
- ".github/workflows/proxy.yml"
branches:
- main
- dev
pull_request: {}
workflow_dispatch: {}
permissions:
actions: write
contents: read
jobs:
typecheck:
runs-on: ubuntu-latest
name: Typecheck
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.10.1
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: ⎔ Setup pnpm@v7
uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: ⎔ Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: 📥 Download deps
run: pnpm install --ignore-scripts
- name: 🔎 Type check
run: pnpm run typecheck --filter proxy
tests:
name: ⚡ Tests
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.10.1
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: ⎔ Setup pnpm@v7
uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: 🏄 Copy test env vars
run: cp .env.example .env
- name: ⎔ Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: 📥 Download deps
run: pnpm install --ignore-scripts
- name: ⚡ Run tests
run: pnpm run test --filter proxy
deploy:
runs-on: ubuntu-latest
name: Deploy
needs: [typecheck, tests]
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.10.1
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: ⎔ Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: ⎔ Setup pnpm@v7
uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: 📥 Download deps
run: pnpm install --ignore-scripts
- name: 🚀 Deploy Staging
if: ${{ github.ref == 'refs/heads/dev' }}
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: publish --env=staging
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: "./apps/proxy"
- name: 🚀 Deploy Production
if: ${{ github.ref == 'refs/heads/main' }}
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: publish --env=production
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: "./apps/proxy"