This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.88 KB
/
pull-request.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
on:
pull_request:
branches: [main]
jobs:
build:
permissions:
contents: 'read'
id-token: 'write'
checks: 'write'
pull-requests: 'write'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'yarn'
- name: Install dependencies
run: yarn
- name: Execute unit tests
run: yarn test
- name: Get PR sha
id: get_pull_request_sha
run: |
pull_request_sha=$(jq --raw-output .pull_request.base.sha "$GITHUB_EVENT_PATH" | cut -c1-8)
echo "pull_request_sha=${pull_request_sha}" >> $GITHUB_OUTPUT
echo $pull_request_sha
- name: Neon Database Create Branch Action
uses: neondatabase/create-branch-action@v5
id: create_branch
if: github.actor != 'dependabot[bot]'
with:
project_id: ${{ secrets.NEON_PROJECT_ID }}
parent: dev
branch_name: ${{steps.get_pull_request_sha.outputs.pull_request_sha}}
api_key: ${{ secrets.NEON_API_KEY }}
username: ${{ secrets.PG_USERNAME }}
- name: Build project
run: yarn build
env:
AUTH_GITHUB_ID: '${{ secrets.AUTH_GITHUB_ID }}'
AUTH_GITHUB_SECRET: '${{ secrets.AUTH_GITHUB_SECRET }}'
AUTH_SECRET: '${{ secrets.AUTH_SECRET }}'
DATABASE_URL: '${{ steps.create_branch.outputs.db_url_with_pooler }}/neondb?pgbouncer=true&connect_timeout=10&sslmode=require'
VITE_API_ENDPOINT: '/api/graphql'
- name: Run Drizzle migrate
if: github.actor != 'dependabot[bot]'
run: |
yarn db:push
env:
DATABASE_URL: '${{ steps.create_branch.outputs.db_url_with_pooler }}/neondb?pgbouncer=true&connect_timeout=10&sslmode=require'