Open History to see the last commit
1name: Deploy T3 Connect relay
2
3on:
4 push:
5 branches:
6 - main
7
8permissions:
9 contents: read
10 id-token: none
11 statuses: write
12
13concurrency:
14 group: relay-production
15 cancel-in-progress: false
16
17jobs:
18 deploy_relay:
19 name: Deploy production relay
20 runs-on: blacksmith-8vcpu-ubuntu-2404
21 timeout-minutes: 15
22 environment:
23 name: production
24 env:
25 CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
26 PLANETSCALE_ORGANIZATION: ${{ vars.PLANETSCALE_ORGANIZATION }}
27 AXIOM_ORG_ID: ${{ vars.AXIOM_ORG_ID }}
28 RELAY_DOMAIN: ${{ vars.RELAY_DOMAIN }}
29 RELAY_API_ZONE_NAME: ${{ vars.RELAY_API_ZONE_NAME }}
30 RELAY_TUNNEL_ZONE_NAME: ${{ vars.RELAY_TUNNEL_ZONE_NAME }}
31 CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_PUBLISHABLE_KEY }}
32 CLERK_JWT_AUDIENCE: ${{ vars.CLERK_JWT_AUDIENCE }}
33 APNS_ENVIRONMENT: ${{ vars.APNS_ENVIRONMENT }}
34 APNS_TEAM_ID: ${{ vars.APNS_TEAM_ID }}
35 APNS_KEY_ID: ${{ vars.APNS_KEY_ID }}
36 APNS_BUNDLE_ID: ${{ vars.APNS_BUNDLE_ID }}
37 ALCHEMY_TELEMETRY_DISABLED: "1"
38 steps:
39 - name: Checkout
40 uses: actions/checkout@v6
41 with:
42 sparse-checkout: |
43 /*
44 !/.repos/
45 sparse-checkout-cone-mode: false
46
47 - name: Setup Vite+
48 uses: voidzero-dev/setup-vp@v1
49 with:
50 node-version-file: package.json
51 cache: true
52 run-install: |
53 args:
54 - --filter=t3code-relay...
55
56 - name: Deploy production relay stage
57 run: vp run --filter t3code-relay deploy --stage prod --yes --no-input
58 env:
59 # The PublishClientConfig action writes the client env here instead
60 # of the repo-root .env; nothing on the runner reads it.
61 T3CODE_RELAY_CLIENT_CONFIG_ENV: ${{ runner.temp }}/relay-client-config.env
62 CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
63 PLANETSCALE_API_TOKEN_ID: ${{ secrets.PLANETSCALE_API_TOKEN_ID }}
64 PLANETSCALE_API_TOKEN: ${{ secrets.PLANETSCALE_API_TOKEN }}
65 AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }}
66 CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
67 APNS_PRIVATE_KEY: ${{ secrets.APNS_PRIVATE_KEY }}
68 FCM_SERVICE_ACCOUNT: ${{ secrets.FCM_SERVICE_ACCOUNT }}
69
70 - name: Publish relay deploy commit status
71 uses: actions/github-script@v8
72 with:
73 script: |
74 await github.rest.repos.createCommitStatus({
75 owner: context.repo.owner,
76 repo: context.repo.repo,
77 sha: context.sha,
78 state: "success",
79 context: "Relay deploy / production",
80 description: "Relay production deploy completed.",
81 target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
82 });