Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

deploy-relay.yml

80 lines2.8 KB

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​
42 - name: Setup Vite+
43 uses: voidzero-dev/setup-vp@v1
44 with:
45 node-version-file: package.json
46 cache: true
47 run-install: true
48​
49 - name: Deploy production relay stage
50 id: deploy
51 run: vp run --filter t3code-relay deploy --stage prod --yes --github-output
52 env:
53 CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
54 PLANETSCALE_API_TOKEN_ID: ${{ secrets.PLANETSCALE_API_TOKEN_ID }}
55 PLANETSCALE_API_TOKEN: ${{ secrets.PLANETSCALE_API_TOKEN }}
56 AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }}
57 CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
58 APNS_PRIVATE_KEY: ${{ secrets.APNS_PRIVATE_KEY }}
59​
60 - name: Publish relay deploy commit status
61 uses: actions/github-script@v8
62 with:
63 script: |
64 const result = "${{ steps.deploy.outputs.result }}";
65 const changed = "${{ steps.deploy.outputs.changed }}" === "true";
66 const description = changed
67 ? "Relay production deploy applied infrastructure changes."
68 : result === "noop"
69 ? "Relay production deploy was a no-op."
70 : `Relay production deploy completed with result: ${result}.`;
71​
72 await github.rest.repos.createCommitStatus({
73 owner: context.repo.owner,
74 repo: context.repo.repo,
75 sha: context.sha,
76 state: "success",
77 context: "Relay deploy / production",
78 description,
79 target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
80 });