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