Repository navigation
90 lines (79 loc) · 2.7 KB
/
Copy pathdeploy-web.yml
File metadata and controls
90 lines (79 loc) · 2.7 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
name: Deploy styal web
# Rolling deployment of the hosted web app. Mirrors deploy-relay.yml's trigger
# rather than upstream's release-gated Vercel deploy: styal has no stable
# desktop release yet, so gating on one would mean never deploying.
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: styal-web-production
cancel-in-progress: false
jobs:
changes:
name: Check for web changes
if: github.repository == 'incognitojam/t3code' || github.repository == 'incognitojam/styal'
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
outputs:
deploy: ${{ github.event_name == 'workflow_dispatch' || steps.changed.outputs.changed == 'true' }}
steps:
- name: Checkout
if: github.event_name == 'push'
uses: actions/checkout@v7
with:
fetch-depth: 0
- id: changed
if: github.event_name == 'push'
uses: ./.github/actions/changed-since-last-deploy
env:
GH_TOKEN: ${{ github.token }}
with:
workflow: deploy-web.yml
paths: |
apps/web
packages
infra/web
.github/workflows/deploy-web.yml
.github/actions/changed-since-last-deploy
deploy_web:
name: Deploy hosted web app
needs: changes
if: needs.changes.outputs.deploy == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 20
environment:
name: production
env:
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
STYAL_WEB_DOMAIN: ${{ vars.STYAL_WEB_DOMAIN }}
ALCHEMY_TELEMETRY_DISABLED: "1"
# Public client configuration baked into the bundle. Never set
# VITE_HTTP_URL or VITE_WS_URL here: the hosted app must stay
# origin-relative or every remote browser breaks.
VITE_CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_PUBLISHABLE_KEY }}
VITE_CLERK_JWT_TEMPLATE: ${{ vars.CLERK_JWT_TEMPLATE }}
VITE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ vars.CLERK_CLI_OAUTH_CLIENT_ID }}
VITE_T3CODE_RELAY_URL: ${{ vars.RELAY_URL }}
VITE_HOSTED_APP_URL: https://${{ vars.STYAL_WEB_DOMAIN }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Node
uses: actions/setup-node@v7
with:
node-version-file: package.json
- name: Install vite-plus
run: npm install -g vite-plus
- name: Install dependencies
run: vp install --ignore-scripts --filter '@t3tools/web...' --filter 'styal-web-infra...'
- name: Deploy
working-directory: infra/web
run: vp run deploy --stage prod --yes
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}