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
8permissions:8permissions:
9 contents: read9 contents: read
10 id-token: none10 id-token: none
11 statuses: write
11 12
12concurrency:13concurrency:
13 group: relay-production14 group: relay-production
@@ -46,7 +47,8 @@ jobs: · 32 unmodified lines
46 run-install: true47 run-install: true
47 48
48 - name: Deploy production relay stage49 - name: Deploy production relay stage
49 run: vp run --filter t3code-relay deploy --stage prod --yes50 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 });

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