Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .github/workflows/local-quickstart-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Local quickstart smoke

on:
pull_request:
paths:
- ".github/workflows/local-quickstart-smoke.yml"
- "docker-compose.yml"
- "docs/local-development.md"
- "packages/database/package.json"
- "pnpm-lock.yaml"
workflow_dispatch:

permissions:
contents: read

jobs:
quickstart:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
FFMPEG_PATH: /usr/bin/ffmpeg
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with: { version: 9.15.0 }
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- name: Install FFmpeg and fonts
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ffmpeg fonts-dejavu-core
- name: Configure fake local-only secrets
run: |
cp .env.example .env
node <<'NODE'
const fs = require("node:fs");
const crypto = require("node:crypto");
let env = fs.readFileSync(".env", "utf8");
for (const key of ["AUTH_SECRET", "ENCRYPTION_KEY"]) {
const value = crypto.randomBytes(32).toString("base64");
const line = new RegExp(`^${key}=.*$`, "m");
if (!line.test(env)) throw new Error(`Missing ${key} in .env.example`);
env = env.replace(line, `${key}=${value}`);
}
fs.writeFileSync(".env", env, { mode: 0o600 });
NODE
- name: Install frozen dependencies
run: pnpm install --frozen-lockfile
- name: Check FFmpeg drawtext support
run: |
/usr/bin/ffmpeg -hide_banner -filters 2>/dev/null | grep -q drawtext
pnpm --filter @contentforge/media exec node -e 'const { spawnSync } = require("node:child_process"); const p = require("ffmpeg-static"); const r = spawnSync(p, ["-hide_banner", "-filters"], { encoding: "utf8" }); console.log("Bundled FFmpeg drawtext:", /drawtext/.test(r.stdout ?? ""));'
- name: Start Docker PostgreSQL
run: docker compose up -d postgres
- name: Wait for PostgreSQL
run: |
for attempt in $(seq 1 30); do
if docker compose exec -T postgres pg_isready -U contentforge -d contentforge_dev > /dev/null 2>&1; then
echo "PostgreSQL is ready"
exit 0
fi
sleep 2
done
echo "PostgreSQL did not become ready"
exit 1
- name: Migrate, generate Prisma Client, and seed
run: |
pnpm db:migrate
pnpm db:generate
pnpm db:seed
- name: Start web, worker, renderer and verify readiness
run: |
pnpm dev > "$RUNNER_TEMP/contentforge-dev.log" 2>&1 &
dev_pid=$!
trap 'kill "$dev_pid" 2>/dev/null || true' EXIT
for attempt in $(seq 1 90); do
if curl --fail --silent --max-time 4 http://127.0.0.1:3000/sign-in -o /dev/null \
&& curl --fail --silent --max-time 4 http://127.0.0.1:3001/readyz -o /dev/null \
&& curl --fail --silent --max-time 4 http://127.0.0.1:3002/readyz -o /dev/null; then
echo "Web, worker and renderer are ready"
exit 0
fi
if ! kill -0 "$dev_pid" 2>/dev/null; then
echo "pnpm dev exited before all services were ready"
exit 1
fi
sleep 2
done
echo "Timed out waiting for all services"
exit 1
- name: Diagnostic service status (no environment values)
if: failure()
run: |
docker compose ps || true
if [ -f "$RUNNER_TEMP/contentforge-dev.log" ]; then
grep -E 'Queue service started|Ready in|started server' "$RUNNER_TEMP/contentforge-dev.log" || true
fi
- name: Stop database without removing data
if: always()
run: docker compose down || true
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
POSTGRES_PASSWORD: contentforge
POSTGRES_DB: contentforge_dev
ports:
- "5432:5432"
- "127.0.0.1:5432:5432"
volumes:
- contentforge_postgres_data:/var/lib/postgresql/data
healthcheck:
Expand All @@ -27,7 +27,7 @@ services:
postgres:
condition: service_healthy
ports:
- "8080:8080"
- "127.0.0.1:8080:8080"
environment:
ADMINER_DEFAULT_SERVER: postgres

Expand All @@ -46,7 +46,7 @@ services:
volumes:
- contentforge_media:/data
ports:
- "3000:3000"
- "127.0.0.1:3000:3000"

worker:
build:
Expand All @@ -64,7 +64,7 @@ services:
volumes:
- contentforge_media:/data
ports:
- "3001:3001"
- "127.0.0.1:3001:3001"

renderer:
build:
Expand All @@ -82,7 +82,7 @@ services:
volumes:
- contentforge_media:/data
ports:
- "3002:3002"
- "127.0.0.1:3002:3002"

volumes:
contentforge_postgres_data:
Expand Down
Loading