Skip to content

Commit aeb5f3a

Browse files
committed
add db
1 parent 1b7f4c2 commit aeb5f3a

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/build-and-push.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,26 @@ jobs:
3434
build:
3535
runs-on: ubuntu-latest
3636
environment: production
37+
env:
38+
BUILD_OUTPUT: standalone
39+
40+
services:
41+
postgres:
42+
image: postgres:16
43+
ports:
44+
- 5432:5432
45+
env:
46+
POSTGRES_DB: payload
47+
POSTGRES_USER: payload
48+
POSTGRES_PASSWORD: payload
49+
options: >-
50+
--health-cmd="pg_isready -U payload"
51+
--health-interval=10s
52+
--health-timeout=5s
53+
--health-retries=5
3754
3855
steps:
39-
- name: Checkout
56+
- name: Checkout source
4057
uses: actions/checkout@v4
4158
with:
4259
fetch-depth: 0
@@ -50,6 +67,9 @@ jobs:
5067
- name: Install dependencies
5168
run: pnpm install --frozen-lockfile
5269

70+
- name: Migrate database
71+
run: pnpm payload migrate
72+
5373
- name: Build Next (standalone)
5474
run: pnpm build
5575

next.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const nextConfig = {
3333
},
3434
reactStrictMode: true,
3535
redirects,
36-
output: 'standalone',
36+
output: process.env.BUILD_OUTPUT || undefined,
3737
typescript: {
3838
ignoreBuildErrors: true,
3939
},

0 commit comments

Comments
 (0)