History

publish deploy status on relay deploy workflow

Julius Marminge committed 5 months ago

Commit 94fc1171 parent 113b9d83 files · +96 −9Browse files

Showing the changes to .github (1 of 3 files). Show all

Unified · Split

.github/workflows/deploy-relay.yml+25−1
@@ -8,6 +8,7 @@ on: · 7 unmodified lines
88 permissions:
99 contents: read
1010 id-token: none
11+ statuses: write
1112
1213 concurrency:
1314 group: relay-production
@@ -46,7 +47,8 @@ jobs: · 32 unmodified lines
4647 run-install: true
4748
4849 - 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
5052 env:
5153 CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
5254 PLANETSCALE_API_TOKEN_ID: ${{ secrets.PLANETSCALE_API_TOKEN_ID }}
@@ -54,3 +56,25 @@ jobs: · 1 unmodified line
5456 AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }}
5557 CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
5658 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+ });

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t