Run the complete PROMPT stack and CI verification in Docker
PROMPT Docker CI and deployment / verify-and-deploy (push) Successful in 14m10s

This commit is contained in:
2026-10-23 00:19:08 +08:00
parent 8b650fdf78
commit 818b1894e7
13 changed files with 296 additions and 268 deletions
+17 -28
View File
@@ -1,4 +1,4 @@
name: PROMPT CI and deployment
name: PROMPT Docker CI and deployment
on:
push:
@@ -9,42 +9,31 @@ on:
jobs:
verify-and-deploy:
runs-on: ces-control
timeout-minutes: 35
timeout-minutes: 45
env:
PROMPT_IMAGE: prompt:${{ gitea.sha }}
PROMPT_TEST_IMAGE: prompt-tests:${{ gitea.sha }}
RELEASE_SHA: ${{ gitea.sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run typecheck
- name: Unit tests
run: npm test
- name: Production build
run: npm run build
- name: Test standalone production server
run: npm run test:smoke
- name: Prepare Docker and FFmpeg for isolated integration tests
- name: Prepare Docker Engine and Compose
run: |
set -eu
if [ "$(id -u)" -eq 0 ]; then SUDO=""; else SUDO="sudo -n"; fi
if ! command -v docker >/dev/null || ! docker compose version >/dev/null 2>&1; then
$SUDO apt-get update -qq
$SUDO apt-get install -y docker.io docker-compose-v2
$SUDO systemctl enable --now docker
fi
if ! command -v ffmpeg >/dev/null; then
$SUDO apt-get update -qq
$SUDO apt-get install -y ffmpeg
fi
- name: Test real PostgreSQL, S3 and video processing in isolation
$SUDO systemctl enable --now docker
- name: Validate the Compose configuration
run: docker compose --env-file .env.example config --quiet
- name: Type check, unit tests, production build and smoke test inside Docker
run: docker build --target integration -t "$PROMPT_TEST_IMAGE" .
- name: Build non-root production image with bundled FFmpeg
run: docker build --target runtime -t "$PROMPT_IMAGE" .
- name: Test the complete isolated Docker stack
run: bash scripts/integration.sh
- name: Deploy persistent systemd service
- name: Deploy the persistent Docker Compose stack
if: gitea.ref == 'refs/heads/main' && (gitea.event_name == 'push' || gitea.event_name == 'workflow_dispatch')
env:
RELEASE_SHA: ${{ gitea.sha }}
run: bash scripts/deploy.sh "$RELEASE_SHA" "$(command -v node)"
run: bash scripts/deploy.sh "$RELEASE_SHA"