forked from Nova-reward/Nova-Rewards
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (33 loc) · 1.32 KB
/
Copy pathvercel-preview.yml
File metadata and controls
37 lines (33 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Vercel Preview Deployment
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'novaRewards/frontend/**'
- '.github/workflows/vercel-preview.yml'
jobs:
deploy-preview:
runs-on: ubuntu-latest
if: ${{ secrets.VERCEL_TOKEN != '' }}
steps:
- uses: actions/checkout@v7
- name: Deploy to Vercel (Preview)
id: vercel-deploy
uses: amondnet/vercel-action@v42
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./novaRewards/frontend
- name: Post deployment comment
if: success()
uses: actions/github-script@v9
with:
script: |
const commentBody = `## 🚀 Vercel Preview Deployment Ready\n\n✅ Your frontend preview environment is ready for testing!\n\n- **Preview URL**: ${{ steps.vercel-deploy.outputs.preview-url }}\n- **Commit**: \`${{ github.event.pull_request.head.sha }}\`\n\nChanges are deployed automatically on new commits.`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});