Skip to content

Commit c82b7a8

Browse files
committed
ci: add staging deploy job for PRs
Deploy to vp-setup-staging on pull requests after tests pass, using the project config from .void/project.json. Comments on the PR with the staging preview URL after successful deployment.
1 parent 77ac9b0 commit c82b7a8

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
pull_request:
66
branches: [main]
77

8+
permissions:
9+
pull-requests: write
10+
811
jobs:
912
test:
1013
runs-on: ubuntu-latest
@@ -19,3 +22,29 @@ jobs:
1922
- run: vp check
2023
- run: vp build
2124
- run: vp test
25+
26+
staging-deploy:
27+
needs: test
28+
if: github.event_name == 'pull_request'
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v6
32+
- uses: voidzero-dev/setup-vp@v1
33+
with:
34+
cache: true
35+
registry-url: https://npm.pkg.github.com
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
38+
- run: vpx void deploy
39+
env:
40+
VOID_TOKEN: ${{ secrets.VOID_TOKEN }}
41+
- name: Comment on PR
42+
uses: actions/github-script@v7
43+
with:
44+
script: |
45+
github.rest.issues.createComment({
46+
owner: context.repo.owner,
47+
repo: context.repo.repo,
48+
issue_number: context.issue.number,
49+
body: '✅ Staging deployment successful!\n\nPreview: https://vp-setup-staging.void.app/'
50+
})

0 commit comments

Comments
 (0)