Showing the changes to .github (1 of 3 files). Show all
Unified · Split
| @@ -8,6 +8,7 @@ on: · 7 unmodified lines | |||
| 8 | permissions: | 8 | permissions: |
| 9 | contents: read | 9 | contents: read |
| 10 | id-token: none | 10 | id-token: none |
| 11 | statuses: write | ||
| 11 | 12 | ||
| 12 | concurrency: | 13 | concurrency: |
| 13 | group: relay-production | 14 | group: relay-production |
| @@ -46,7 +47,8 @@ jobs: · 32 unmodified lines | |||
| 46 | run-install: true | 47 | run-install: true |
| 47 | 48 | ||
| 48 | - name: Deploy production relay stage | 49 | - name: Deploy production relay stage |
| 49 | run: vp run --filter t3code-relay deploy --stage prod --yes | 50 | id: deploy |
| 51 | run: vp run --filter t3code-relay deploy --stage prod --yes --github-output | ||
| 50 | env: | 52 | env: |
| 51 | CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | 53 | CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} |
| 52 | PLANETSCALE_API_TOKEN_ID: ${{ secrets.PLANETSCALE_API_TOKEN_ID }} | 54 | PLANETSCALE_API_TOKEN_ID: ${{ secrets.PLANETSCALE_API_TOKEN_ID }} |
| @@ -54,3 +56,25 @@ jobs: · 1 unmodified line | |||
| 54 | AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }} | 56 | AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }} |
| 55 | CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }} | 57 | CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }} |
| 56 | APNS_PRIVATE_KEY: ${{ secrets.APNS_PRIVATE_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 | }); | ||