Conversation
… for entire project
chore: remove pnpm-workspace.yaml configuration file and setup docker for entire project
Comment on lines
+63
to
+121
| name: Docker prod smoke | ||
| runs-on: ubuntu-latest | ||
| # Fail fast rather than sitting until GitHub's 6h default if something hangs. | ||
| timeout-minutes: 25 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| # ../velobits-infra owns velobits-net and does not exist in CI. api-prod | ||
| # joins it as external, so it must exist or `up` errors out. No Keycloak is | ||
| # needed here: /health sits outside the /v1/ auth hook and jose's | ||
| # createRemoteJWKSet fetches lazily — only an authenticated request would | ||
| # try to reach it. | ||
| - name: Create the external network the compose file expects | ||
| run: docker network create velobits-net || true | ||
|
|
||
| - name: Start the prod stack | ||
| run: docker compose --profile prod up --build -d | ||
|
|
||
| - name: Wait for the router | ||
| run: | | ||
| for i in $(seq 1 60); do | ||
| if curl -sf -o /dev/null http://localhost:3200/healthz; then | ||
| echo "router up after ${i} attempts"; exit 0 | ||
| fi | ||
| sleep 5 | ||
| done | ||
| echo "router did not become ready" >&2 | ||
| exit 1 | ||
|
|
||
| - name: Smoke — the stack through one origin | ||
| run: | | ||
| set -euo pipefail | ||
| # Dashboard: nginx serves the built SPA at the webroot. | ||
| curl -sf http://localhost:3200/ | grep -q '<div id="root"' | ||
| # SPA history fallback — react-router-dom owns /tools client-side, so a | ||
| # deep link must return the app shell rather than a 404. | ||
| curl -sf -o /dev/null http://localhost:3200/tools | ||
| # Control plane, through the /api prefix strip. | ||
| curl -sf http://localhost:3200/api/health | grep -q '"status":"ok"' | ||
| # Migrations actually ran (api-prod gates on service_completed_successfully). | ||
| docker compose --profile prod exec -T postgres \ | ||
| psql -U toggleflow -d toggleflow -c '\dt' | grep -q ' tools ' | ||
| # Unauthenticated /v1/* is rejected — proves the auth hook is wired. | ||
| test "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:3200/api/v1/me)" = 401 | ||
| # The delivery plane is Cloudflare-only in prod, so /edge/* must 404 | ||
| # rather than fall through to the SPA fallback and return HTML with a 200. | ||
| test "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:3200/edge/health)" = 404 | ||
| # Exactly one of each security header — the router hides the static | ||
| # image's duplicates. | ||
| test "$(curl -sI http://localhost:3200/ | grep -ci '^x-frame-options:')" = 1 | ||
|
|
||
| - name: Dump logs | ||
| if: always() | ||
| run: docker compose --profile prod logs --no-color | tail -200 | ||
|
|
||
| - name: Tear down | ||
| if: always() | ||
| run: docker compose --profile prod down -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.