Skip to content

Commit f324d23

Browse files
committed
ci: add github deployment status tracking
1 parent 7135a27 commit f324d23

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,23 @@ on:
55
branches:
66
- production
77

8+
permissions:
9+
deployments: write
10+
811
jobs:
912
deploy:
1013
runs-on: ubuntu-latest
1114
steps:
1215
- uses: actions/checkout@v4
1316

17+
- name: Create GitHub deployment
18+
id: deployment
19+
uses: chrnorm/deployment-action@v2
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
environment: production
23+
initial-status: in_progress
24+
1425
- uses: pnpm/action-setup@v4
1526
with:
1627
version: latest
@@ -29,7 +40,27 @@ jobs:
2940
NEXT_PUBLIC_WEB3FORMS_KEY: ${{ secrets.NEXT_PUBLIC_WEB3FORMS_KEY }}
3041

3142
- name: Deploy to Vercel
32-
run: npx vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }} --yes
43+
id: vercel
44+
run: |
45+
url=$(npx vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }} --yes)
46+
echo "url=$url" >> $GITHUB_OUTPUT
3347
env:
3448
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
3549
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
50+
51+
- name: Update deployment success
52+
if: success()
53+
uses: chrnorm/deployment-status@v2
54+
with:
55+
token: ${{ secrets.GITHUB_TOKEN }}
56+
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
57+
state: success
58+
environment-url: https://www.rudrasahoo.live
59+
60+
- name: Update deployment failure
61+
if: failure()
62+
uses: chrnorm/deployment-status@v2
63+
with:
64+
token: ${{ secrets.GITHUB_TOKEN }}
65+
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
66+
state: failure

0 commit comments

Comments
 (0)