Skip to content

Commit 95f1931

Browse files
Merge pull request #19 from piyush-jaiswal/ci/preview-deployment-url-comment
comment preview deployment url on PR
2 parents 8dc3ebb + bf50dc8 commit 95f1931

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/deploy_preview.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
deploy-preview:
2121
needs: [test]
2222
runs-on: ubuntu-latest
23+
permissions:
24+
pull-requests: write
2325
# Do not run for PR from forks
2426
if: github.event.pull_request.head.repo.full_name == github.repository
2527

@@ -37,4 +39,11 @@ jobs:
3739
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
3840

3941
- name: Deploy Project Artifacts to Vercel
40-
run: vercel deploy --prebuilt --archive=tgz --token=${{ secrets.VERCEL_TOKEN }}
42+
id: deploy_step
43+
run: echo "preview-url=$(vercel deploy --prebuilt --archive=tgz --token=${{ secrets.VERCEL_TOKEN }})" >> $GITHUB_OUTPUT
44+
45+
- name: Comment Preview URL
46+
uses: marocchino/sticky-pull-request-comment@v2
47+
with:
48+
message: |
49+
Preview: ${{ steps.deploy_step.outputs.preview-url }}

0 commit comments

Comments
 (0)