Skip to content

Commit 5dd7038

Browse files
committed
feat: enhance CI/CD workflow with GitHub deployment steps and error handling for Vercel deployment
1 parent 791251f commit 5dd7038

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/ci-deploy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,37 @@ jobs:
3434
run: npm run build
3535

3636
- name: Deploy to Vercel
37+
id: vercel_deploy
3738
uses: amondnet/vercel-action@v25
39+
continue-on-error: true
3840
with:
3941
vercel-token: ${{ secrets.VERCEL_TOKEN }}
4042
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
4143
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
4244
working-directory: .
4345
vercel-args: '--prod'
46+
47+
- name: Create GitHub deployment
48+
if: always()
49+
id: deployment
50+
uses: bobheadxi/deployments@v1
51+
with:
52+
step: start
53+
token: ${{ secrets.GITHUB_TOKEN }}
54+
env: production
55+
ref: ${{ github.sha }}
56+
57+
- name: Update deployment status
58+
if: always()
59+
uses: bobheadxi/deployments@v1
60+
with:
61+
step: finish
62+
token: ${{ secrets.GITHUB_TOKEN }}
63+
status: ${{ steps.vercel_deploy.outcome == 'success' && 'success' || 'failure' }}
64+
env: ${{ steps.deployment.outputs.env }}
65+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
66+
env_url: https://devcontext.xyz
67+
68+
- name: Fail job if deployment failed
69+
if: ${{ steps.vercel_deploy.outcome != 'success' }}
70+
run: exit 1

0 commit comments

Comments
 (0)