-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (57 loc) · 1.97 KB
/
pr-ci.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
64
65
66
67
68
69
70
71
72
73
74
75
name: PR CI
on: [pull_request]
jobs:
main-ci:
runs-on: ubuntu-latest
environment: CI
env:
# Neon
NEON_DATABASE_USERNAME: ${{ secrets.NEON_DATABASE_USERNAME }}
NEON_API_KEY: ${{ secrets.NEON_API_KEY }}
NEON_PROJECT_ID: ${{ secrets.NEON_PROJECT_ID }}
# Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ vars.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
NEXT_PUBLIC_CLERK_SIGN_IN_URL: '/sign-in'
NEXT_PUBLIC_CLERK_SIGN_UP_URL: '/sign-up'
NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL: '/app'
NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL: '/app'
# Upstash
UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }}
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }}
# Resend
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get branch name
id: branch_name
uses: tj-actions/branch-names@v8
- name: Create Neon Branch
id: create-branch
uses: neondatabase/create-branch-action@v4
with:
project_id: ${{ env.NEON_PROJECT_ID }}
branch_name: pr-${{ github.event.number }}-${{ steps.branch_name.outputs.current_branch }}
username: ${{ env.NEON_DATABASE_USERNAME }}
api_key: ${{ env.NEON_API_KEY }}
- name: Set DATABASE_URL
shell: bash
run: |
echo "DATABASE_URL=${{ steps.create-branch.outputs.db_url }}?sslmode=require" >> $GITHUB_ENV
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install Dependencies
run: bun install
- name: Run DB Migrations
run: bun db:migrate
- name: Check Format
run: bun format:check
- name: Lint
run: bun lint
- name: Typecheck
run: bun typecheck
- name: Build
run: bun run build