ci: deploy website from Forgejo Actions #54

Merged
vince merged 6 commits from codex/forgejo-actions-auto-deploy into main 2026-06-20 17:18:41 +02:00
Owner

Summary

Add a Forgejo Actions workflow that runs CI on pull requests and deploys the website automatically after pushes to main.

Why

The website should deploy from our own Git CI/CD path when changes are merged, instead of relying on manual host commands.

Changes

  • Add .forgejo/workflows/dimensionlab-website.yml with PR CI and main-only deploy jobs.
  • Initialize the packages/ui submodule through HTTPS inside CI.
  • Add a deploy-only container option and Podman socket preflight for the rootless Podman deployment socket.
  • Add scripts/deploy-dimensionlab-website.sh with main-branch/event guards, dry-run mode, image build/tagging, Quadlet-compatible restart, smoke checks, and rollback verification.
  • Run web unit tests under Bun so CI can import bun:sqlite.
  • Add workspace boundary and deploy behavior tests for PR/non-main guards, Quadlet ownership checks, smoke-failure rollback, and restart-failure rollback.

Testing

  • bun --cwd apps/web test src/lib/workspace-boundary.test.ts
  • bash -n scripts/deploy-dimensionlab-website.sh
  • DEPLOY_REF=refs/heads/main DEPLOY_EVENT_NAME=push DEPLOY_SHA=$(git rev-parse HEAD) DEPLOY_RESTART_STRATEGY=quadlet-container DEPLOY_CONTAINER_CLI=podman scripts/deploy-dimensionlab-website.sh --dry-run
  • DEPLOY_REF=refs/heads/codex/test DEPLOY_EVENT_NAME=push DEPLOY_CONTAINER_CLI=podman scripts/deploy-dimensionlab-website.sh --dry-run fails as expected
  • DEPLOY_REF=refs/heads/main DEPLOY_EVENT_NAME=pull_request DEPLOY_CONTAINER_CLI=podman scripts/deploy-dimensionlab-website.sh --dry-run fails as expected
  • Job-image Podman socket preflight with --security-opt label=disable verified against dimensionlab-website.service
  • bun install --frozen-lockfile
  • bun run check
  • bun run test
  • bun run build
  • Forgejo Actions PR run #6: ci successful, deploy skipped on pull_request

Notes

The deploy job only runs when Forgejo reports github.event_name == 'push' and github.ref == 'refs/heads/main'. PRs get CI only; they do not deploy.

## Summary Add a Forgejo Actions workflow that runs CI on pull requests and deploys the website automatically after pushes to main. ## Why The website should deploy from our own Git CI/CD path when changes are merged, instead of relying on manual host commands. ## Changes - Add `.forgejo/workflows/dimensionlab-website.yml` with PR CI and main-only deploy jobs. - Initialize the `packages/ui` submodule through HTTPS inside CI. - Add a deploy-only container option and Podman socket preflight for the rootless Podman deployment socket. - Add `scripts/deploy-dimensionlab-website.sh` with main-branch/event guards, dry-run mode, image build/tagging, Quadlet-compatible restart, smoke checks, and rollback verification. - Run web unit tests under Bun so CI can import `bun:sqlite`. - Add workspace boundary and deploy behavior tests for PR/non-main guards, Quadlet ownership checks, smoke-failure rollback, and restart-failure rollback. ## Testing - `bun --cwd apps/web test src/lib/workspace-boundary.test.ts` - `bash -n scripts/deploy-dimensionlab-website.sh` - `DEPLOY_REF=refs/heads/main DEPLOY_EVENT_NAME=push DEPLOY_SHA=$(git rev-parse HEAD) DEPLOY_RESTART_STRATEGY=quadlet-container DEPLOY_CONTAINER_CLI=podman scripts/deploy-dimensionlab-website.sh --dry-run` - `DEPLOY_REF=refs/heads/codex/test DEPLOY_EVENT_NAME=push DEPLOY_CONTAINER_CLI=podman scripts/deploy-dimensionlab-website.sh --dry-run` fails as expected - `DEPLOY_REF=refs/heads/main DEPLOY_EVENT_NAME=pull_request DEPLOY_CONTAINER_CLI=podman scripts/deploy-dimensionlab-website.sh --dry-run` fails as expected - Job-image Podman socket preflight with `--security-opt label=disable` verified against `dimensionlab-website.service` - `bun install --frozen-lockfile` - `bun run check` - `bun run test` - `bun run build` - Forgejo Actions PR run #6: `ci` successful, `deploy` skipped on pull_request ## Notes The deploy job only runs when Forgejo reports `github.event_name == 'push'` and `github.ref == 'refs/heads/main'`. PRs get CI only; they do not deploy.
vince added 1 commit 2026-06-20 16:46:21 +02:00
ci: deploy website from Forgejo Actions
Some checks failed
Dimension Lab website / ci (pull_request) Failing after 35s
Dimension Lab website / deploy (pull_request) Has been skipped
96fe4d26c7
vince added 1 commit 2026-06-20 16:54:23 +02:00
fix(ci): harden website deploy rollback
Some checks failed
Dimension Lab website / ci (pull_request) Failing after 15s
Dimension Lab website / deploy (pull_request) Has been skipped
7e4d13a85c
vince added 1 commit 2026-06-20 16:58:15 +02:00
fix(ci): run web unit tests with Bun
All checks were successful
Dimension Lab website / ci (pull_request) Successful in 17s
Dimension Lab website / deploy (pull_request) Has been skipped
a010520a94
vince added 1 commit 2026-06-20 16:59:38 +02:00
fix(ci): guard deploy auto fallback
All checks were successful
Dimension Lab website / ci (pull_request) Successful in 17s
Dimension Lab website / deploy (pull_request) Has been skipped
006c7e041f
vince added 1 commit 2026-06-20 17:10:16 +02:00
fix(ci): verify deployment socket and rollback image
All checks were successful
Dimension Lab website / ci (pull_request) Successful in 19s
Dimension Lab website / deploy (pull_request) Has been skipped
d61d296ea1
vince added 1 commit 2026-06-20 17:12:32 +02:00
fix(ci): allow deploy job Podman socket access
All checks were successful
Dimension Lab website / ci (pull_request) Successful in 17s
Dimension Lab website / deploy (pull_request) Has been skipped
35cb1574b4
vince merged commit b087e65978 into main 2026-06-20 17:18:41 +02:00
Sign in to join this conversation.
No description provided.