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 id: deploy
58 run: vp run --filter t3code-relay deploy --stage prod --yes --github-output
59 env:
60 CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
61 PLANETSCALE_API_TOKEN_ID: ${{ secrets.PLANETSCALE_API_TOKEN_ID }}
62 PLANETSCALE_API_TOKEN: ${{ secrets.PLANETSCALE_API_TOKEN }}
63 AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }}
64 CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
65 APNS_PRIVATE_KEY: ${{ secrets.APNS_PRIVATE_KEY }}
66
67 - name: Publish relay deploy commit status
68 uses: actions/github-script@v8
69 with:
70 script: |
71 const result = "${{ steps.deploy.outputs.result }}";
72 const changed = "${{ steps.deploy.outputs.changed }}" === "true";
73 const description = changed
74 ? "Relay production deploy applied infrastructure changes."
75 : result === "noop"
76 ? "Relay production deploy was a no-op."
77 : `Relay production deploy completed with result: ${result}.`;
78
79 await github.rest.repos.createCommitStatus({
80 owner: context.repo.owner,
81 repo: context.repo.repo,
82 sha: context.sha,
83 state: "success",
84 context: "Relay deploy / production",
85 description,
86 target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
87 });