Skip to content

Preview workflow: queue/q<id> builds served at q<id>.preview.home - #25

Merged
deadp merged 1 commit into
complete-gamefrom
preview-workflow
Oct 27, 2026
Merged

deadp merged 1 commit into
complete-gamefrom
preview-workflow

Conversation

@deadp

@deadp deadp commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Adds .github/workflows/preview.yml so every queue branch gets a playable preview at http://q<id>.preview.home/. Job 604 wrote this first, but the queue's publish gate refuses worker changes to .github/workflows, so this PR is the hand-written version for review.

build (push to queue/q*): runs npm ci --ignore-scripts and npm run build on the homelab self-hosted runner, as CI does. It then force-pushes packages/game/dist as public/ on preview/q<id>, as a single orphan commit holding built files only, with no source and no history.

remove (delete of queue/q*): deletes preview/q<id>. Delete events run from the default branch, so this half only works after merge.

Safety:

  • contents: write with GITHUB_TOKEN only.
  • No pull_request_target, so fork PRs never run this workflow.
  • The branch name reaches the shell only through env, and must match queue/q[A-Za-z0-9_-]+.
  • Pushes made with GITHUB_TOKEN start no workflows, so preview branches never trigger CI.

The other half is in homelab stacks/preview. The sync now also lists blue-sheep (public, over HTTPS) and serves preview/q<id> only while queue/q<id> exists.

Tested locally: the publish step was run against a bare repo. It produced a tree of public/... only, left the workspace clean, and rejected a malicious branch name.

🤖 Generated with Claude Code

…ew.home

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@deadp
deadp merged commit 0f1383c into complete-game Oct 27, 2026
2 checks passed
@deadp
deadp deleted the preview-workflow branch October 27, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant