Deploy a preview per PR and remove it on close #306

Closed
opened 2026-10-09 09:19:51 +00:00 by root · 12 comments
root commented 2026-10-09 09:19:51 +00:00 (Migrated from gitlab.core-project.space)

Imported from GitHub amaurycoudr/chess-project#306, opened by @amaurycoudr on 2026-10-09 09:19 UTC.
Closed on GitHub on 2026-10-09 12:20 UTC as completed.


Parent

#303

What to build

Every PR whose head branch is in the repo gets a public preview at https://pr-<n>.chess.core-project.space, redeployed on each push and removed when the PR closes.

The preview workflow builds and pushes the image tagged for the PR, then deploys the same deploy compose as production as stack chess-pr-<n>, with its own host, ORIGIN_ALLOWLIST set to that origin, a deploy-time label, and a response-header middleware adding X-Robots-Tag: noindex. It posts the preview URL in one PR comment, updated rather than duplicated on later pushes. Fork PRs never reach a step that holds a secret.

On PR close (merged or not), a workflow removes the PR's stack with its volumes, and succeeds when the stack is already gone.

Seam: Workflow post-conditions

Acceptance criteria

  • Opening a PR from the repo deploys chess-pr-<n>, reachable over HTTPS with a valid certificate
  • A push to the PR redeploys the preview with the new commit's image
  • The PR carries exactly one comment with the preview URL
  • A fork PR deploys nothing and exposes no secret
  • The deploy workflow ends by checking the stack runs one container, HTTPS answers GET /, and the response carries X-Robots-Tag: noindex
  • Closing or merging the PR removes the stack and its volumes; the close workflow checks the stack is gone, and passes when it was already gone
  • Production is untouched by any preview deploy or cleanup
> _Imported from GitHub [amaurycoudr/chess-project#306](https://github.com/amaurycoudr/chess-project/issues/306), opened by [@amaurycoudr](https://github.com/amaurycoudr) on 2026-10-09 09:19 UTC._ > _Closed on GitHub on 2026-10-09 12:20 UTC as completed._ <!-- github-issue:306 --> --- ## Parent #303 ## What to build Every PR whose head branch is in the repo gets a public preview at `https://pr-<n>.chess.core-project.space`, redeployed on each push and removed when the PR closes. The preview workflow builds and pushes the image tagged for the PR, then deploys the same deploy compose as production as stack `chess-pr-<n>`, with its own host, `ORIGIN_ALLOWLIST` set to that origin, a deploy-time label, and a response-header middleware adding `X-Robots-Tag: noindex`. It posts the preview URL in one PR comment, updated rather than duplicated on later pushes. Fork PRs never reach a step that holds a secret. On PR close (merged or not), a workflow removes the PR's stack with its volumes, and succeeds when the stack is already gone. Seam: Workflow post-conditions ## Acceptance criteria - [ ] Opening a PR from the repo deploys `chess-pr-<n>`, reachable over HTTPS with a valid certificate - [ ] A push to the PR redeploys the preview with the new commit's image - [ ] The PR carries exactly one comment with the preview URL - [ ] A fork PR deploys nothing and exposes no secret - [ ] The deploy workflow ends by checking the stack runs one container, HTTPS answers `GET /`, and the response carries `X-Robots-Tag: noindex` - [ ] Closing or merging the PR removes the stack and its volumes; the close workflow checks the stack is gone, and passes when it was already gone - [ ] Production is untouched by any preview deploy or cleanup
root commented 2026-10-09 09:19:51 +00:00 (Migrated from gitlab.core-project.space)

GitHub issue relations, imported as "related" links (GitLab CE has no sub-issues or blocking links).

> _GitHub issue relations, imported as "related" links (GitLab CE has no sub-issues or blocking links)._ <!-- github-relations --> - Parent (sub-issue of): #303 - Blocked by: #304 - Blocking: #310, #308, #307
root (Migrated from gitlab.core-project.space) closed this issue 2026-10-09 12:20:43 +00:00
root commented 2026-10-13 08:39:26 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #307

mentioned in issue #307
root commented 2026-10-13 08:39:26 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #308

mentioned in issue #308
root commented 2026-10-13 08:39:27 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #310

mentioned in issue #310
root commented 2026-10-13 08:41:06 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #303

mentioned in issue #303
root commented 2026-10-13 08:41:06 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #304

mentioned in issue #304
root commented 2026-10-13 08:42:06 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #303

marked this issue as related to #303
root commented 2026-10-13 08:42:09 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #304

marked this issue as related to #304
root commented 2026-10-13 08:42:10 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #310

marked this issue as related to #310
root commented 2026-10-13 08:42:10 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #308

marked this issue as related to #308
root commented 2026-10-13 08:42:10 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #307

marked this issue as related to #307
root commented 2026-10-13 10:28:28 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit aad3b4c624

mentioned in commit aad3b4c6240d057e909cdead79488e625d4a6803
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks Depends on
#304 Deploy production to the VPS
amaurycoudr/chess-project
Reference
amaurycoudr/chess-project#306
No description provided.