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 RELAY_TUNNEL_CLEANUP_MODE: ${{ vars.RELAY_TUNNEL_CLEANUP_MODE }}
32 CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_PUBLISHABLE_KEY }}
33 CLERK_JWT_AUDIENCE: ${{ vars.CLERK_JWT_AUDIENCE }}
34 APNS_ENVIRONMENT: ${{ vars.APNS_ENVIRONMENT }}
35 APNS_TEAM_ID: ${{ vars.APNS_TEAM_ID }}
36 APNS_KEY_ID: ${{ vars.APNS_KEY_ID }}
37 APNS_BUNDLE_ID: ${{ vars.APNS_BUNDLE_ID }}
38 ALCHEMY_TELEMETRY_DISABLED: "1"
39 steps:
40 - name: Checkout
41 uses: actions/checkout@v6
42 with:
43 sparse-checkout: |
44 /*
45 !/.repos/
46 sparse-checkout-cone-mode: false
47
48 - name: Setup Vite+
49 uses: voidzero-dev/setup-vp@v1
50 with:
51 node-version-file: package.json
52 cache: true
53 run-install: |
54 args:
55 - --filter=t3code-relay...
56
57 - name: Deploy production relay stage
58 run: vp run --filter t3code-relay deploy --stage prod --yes --no-input
59 env:
60 # The PublishClientConfig action writes the client env here instead
61 # of the repo-root .env; nothing on the runner reads it.
62 T3CODE_RELAY_CLIENT_CONFIG_ENV: ${{ runner.temp }}/relay-client-config.env
63 CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
64 PLANETSCALE_API_TOKEN_ID: ${{ secrets.PLANETSCALE_API_TOKEN_ID }}
65 PLANETSCALE_API_TOKEN: ${{ secrets.PLANETSCALE_API_TOKEN }}
66 AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }}
67 CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
68 APNS_PRIVATE_KEY: ${{ secrets.APNS_PRIVATE_KEY }}
69 FCM_SERVICE_ACCOUNT: ${{ secrets.FCM_SERVICE_ACCOUNT }}
70
71 - name: Publish relay deploy commit status
72 uses: actions/github-script@v8
73 with:
74 script: |
75 await github.rest.repos.createCommitStatus({
76 owner: context.repo.owner,
77 repo: context.repo.repo,
78 sha: context.sha,
79 state: "success",
80 context: "Relay deploy / production",
81 description: "Relay production deploy completed.",
82 target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
83 });