File tree 1 file changed +20
-3
lines changed
1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change 5
5
branches :
6
6
- vercel-preview
7
7
pull_request :
8
- types : [opened, synchronize]
8
+ types : [opened, synchronize, labeled ]
9
9
10
10
concurrency :
11
- group : vercel
11
+ group : netlify
12
12
cancel-in-progress : false
13
13
14
14
jobs :
15
15
run :
16
+ if : ${{ github.event.label.name == 'preview' }}
16
17
runs-on : ubuntu-latest
17
18
env :
18
19
REPO_ACCESS_TOKEN : ${{ secrets.REPO_ACCESS_TOKEN }}
69
70
--dir public \
70
71
--site ${{ secrets.NETLIFY_SITE_ID }} \
71
72
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
72
- --json
73
+ --json \
74
+ > deploy_output.json
75
+
76
+ - name : Generate URL Preview
77
+ id : url_preview
78
+ run : |
79
+ NETLIFY_PREVIEW_URL=$(jq -r '.deploy_url' deploy_output.json)
80
+ echo "NETLIFY_PREVIEW_URL=$NETLIFY_PREVIEW_URL" >> "$GITHUB_OUTPUT"
81
+
82
+ - name : Create PR Preview Comment
83
+ if : github.event_name == 'pull_request'
84
+ uses :
peter-evans/[email protected]
85
+ with :
86
+ issue-number : ${{ github.event.pull_request.number }}
87
+ body : |
88
+ 🚀 Preview this PR: ${{ steps.url_preview.outputs.NETLIFY_PREVIEW_URL }}
89
+ 📍 Commit SHA: ${{ github.sha }}
You can’t perform that action at this time.
0 commit comments