1- name : Create/Delete Branch for Pull Request
2-
1+ name : Deploy Vial MCP to GitHub Pages
32on :
3+ push :
4+ branches :
5+ - main
46 pull_request :
57 types :
68 - opened
79 - reopened
810 - synchronize
911 - closed
10-
1112concurrency :
1213 group : ${{ github.workflow }}-${{ github.ref }}
13-
1414jobs :
1515 setup :
1616 name : Setup
@@ -21,55 +21,51 @@ jobs:
2121 - name : Get branch name
2222 id : branch_name
2323 uses : tj-actions/branch-names@v8
24-
2524 create_neon_branch :
2625 name : Create Neon Branch
2726 outputs :
28- db_url : ${{ steps.create_neon_branch_encode .outputs.db_url }}
29- db_url_with_pooler : ${{ steps.create_neon_branch_encode .outputs.db_url_with_pooler }}
27+ db_url : ${{ steps.create_neon_branch .outputs.db_url }}
28+ db_url_with_pooler : ${{ steps.create_neon_branch .outputs.db_url_with_pooler }}
3029 needs : setup
3130 if : |
3231 github.event_name == 'pull_request' && (
33- github.event.action == 'synchronize'
34- || github.event.action == 'opened'
35- || github.event.action == 'reopened')
32+ github.event.action == 'synchronize' ||
33+ github.event.action == 'opened' ||
34+ github.event.action == 'reopened')
3635 runs-on : ubuntu-latest
3736 permissions :
3837 contents : read
3938 pull-requests : write
4039 steps :
4140 - name : Checkout Repository
4241 uses : actions/checkout@v4
43-
4442 - name : Create Neon Branch
4543 id : create_neon_branch
4644 uses : neondatabase/create-branch-action@v5
4745 with :
4846 project_id : ${{ vars.NEON_PROJECT_ID }}
4947 branch_name : preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }}
5048 api_key : ${{ secrets.NEON_API_KEY }}
51-
5249 - name : Run Migrations
5350 run : |
5451 psql -d "${{ steps.create_neon_branch.outputs.db_url_with_pooler }}" -f vial2/mcp/api/database/schema.sql
5552 env :
5653 DATABASE_URL : " ${{ steps.create_neon_branch.outputs.db_url_with_pooler }}"
57-
5854 - name : Post Schema Diff Comment to PR
5955 uses : neondatabase/schema-diff-action@v1
6056 with :
6157 project_id : ${{ vars.NEON_PROJECT_ID }}
6258 compare_branch : preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }}
6359 api_key : ${{ secrets.NEON_API_KEY }}
64-
65- - name : Deploy to Netlify Preview
66- env :
67- NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
68- NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
69- DATABASE_URL : " ${{ steps.create_neon_branch.outputs.db_url_with_pooler }} "
70- run : |
71- netlify deploy --dir=. --alias=pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }}
72-
60+ - name : Deploy to GitHub Pages Preview
61+ uses : actions/upload-pages-artifact@v3
62+ with :
63+ path : .
64+ - name : Deploy to GitHub Pages
65+ id : deployment
66+ uses : actions/deploy-pages@v4
67+ with :
68+ preview : true
7369 delete_neon_branch :
7470 name : Delete Neon Branch
7571 needs : setup
8581 project_id : ${{ vars.NEON_PROJECT_ID }}
8682 branch : preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }}
8783 api_key : ${{ secrets.NEON_API_KEY }}
88-
8984 - name : Comment PR with Cleanup Confirmation
9085 uses : actions/github-script@v6
9186 with :
0 commit comments