Add main-branch deployment workflow for portainer-automation production #140

Closed
opened 2026-07-08 19:23:11 +00:00 by Polly · 2 comments
Member

Description

When code is pushed to the main branch, I want a CI workflow to build, tag (prod, latest, version), and push the portainer-automation image, so the production Portainer stack can pull the latest production image and the production environment stays up to date.

Acceptance Criteria

Happy path — Push to main triggers production build:
GIVEN a push occurs on the main branch
WHEN the CI workflow runs
THEN it builds the portainer-automation image, increments the version, and pushes tags: pa-<version>, prod, and latest

Edge case — Push to main with no version tag yet:
GIVEN the main branch has never had a version tag
WHEN the CI workflow tries to compute the next version
THEN it falls back to a sensible initial version (e.g. 1.0.0) or fails gracefully with a clear error

Error scenario — Registry push fails:
GIVEN the Docker registry is unreachable or credentials are invalid
WHEN the workflow attempts to push images
THEN the workflow fails with a clear error message, and the previous production images remain untouched

Technical Notes

  • Uses the parameterized workflow from #139 (parameterization should be done first)
  • Alternatively, if not yet parameterized, create a standalone workflow portainer_automation_build_push_prod.yml as a mirror of the test workflow but targeting main
  • Image push targets:
    • 192.168.0.100:8928/hithomelabs/portainer-automation:pa-<version>
    • 192.168.0.100:8928/hithomelabs/portainer-automation:prod
    • 192.168.0.100:8928/hithomelabs/portainer-automation:latest
  • Gitea secret TOKEN must already be configured (used in test workflow)
  • No Portainer redeploy trigger in this workflow — that's handled by a separate workflow (see #136)
  • See PORTAINER_STACK.md for production env var reference

Dependencies

Story Points: 5

Priority: high

## Description When code is pushed to the `main` branch, I want a CI workflow to build, tag (`prod`, `latest`, version), and push the portainer-automation image, so the production Portainer stack can pull the latest production image and the production environment stays up to date. ## Acceptance Criteria **Happy path — Push to main triggers production build:** GIVEN a push occurs on the `main` branch WHEN the CI workflow runs THEN it builds the portainer-automation image, increments the version, and pushes tags: `pa-<version>`, `prod`, and `latest` **Edge case — Push to main with no version tag yet:** GIVEN the `main` branch has never had a version tag WHEN the CI workflow tries to compute the next version THEN it falls back to a sensible initial version (e.g. `1.0.0`) or fails gracefully with a clear error **Error scenario — Registry push fails:** GIVEN the Docker registry is unreachable or credentials are invalid WHEN the workflow attempts to push images THEN the workflow fails with a clear error message, and the previous production images remain untouched ## Technical Notes - Uses the parameterized workflow from #139 (parameterization should be done first) - Alternatively, if not yet parameterized, create a standalone workflow `portainer_automation_build_push_prod.yml` as a mirror of the test workflow but targeting `main` - Image push targets: - `192.168.0.100:8928/hithomelabs/portainer-automation:pa-<version>` - `192.168.0.100:8928/hithomelabs/portainer-automation:prod` - `192.168.0.100:8928/hithomelabs/portainer-automation:latest` - Gitea secret `TOKEN` must already be configured (used in test workflow) - No Portainer redeploy trigger in this workflow — that's handled by a separate workflow (see #136) - See `PORTAINER_STACK.md` for production env var reference ## Dependencies - Blocked by: #139 ## Story Points: 5 ## Priority: high
Polly added this to the Portainer Automation — Production & Parameterization milestone 2026-07-08 19:23:11 +00:00
Polly added the
CI/CD
docker
priority:high
story-points:5
user-story
blocked-by:#139
labels 2026-07-08 19:23:24 +00:00
Member

🔗 Dependency Update

#139 is now architect:complete — the final parameterized workflow spec has been approved and is ready for implementation by @Dave.

Key outcome for #140:

  • Once #139 is implemented on test and main, this issue is automatically satisfied
  • The single workflow in #139 handles both test AND main branch pushes
  • No separate workflow file needed for production — the main branch trigger in the parameterized workflow promotes the test image to prod tag
  • See the final spec on #139 comment for details

Waiting on #139 implementation before this can proceed.

### 🔗 Dependency Update **#139** is now `architect:complete` — the final parameterized workflow spec has been approved and is ready for implementation by @Dave. Key outcome for #140: - Once #139 is implemented on `test` and `main`, this issue is automatically satisfied - The single workflow in #139 handles **both** test AND main branch pushes - No separate workflow file needed for production — the `main` branch trigger in the parameterized workflow promotes the test image to `prod` tag - See the final spec on [#139 comment](https://gitea.hithomelabs.com/Hithomelabs/CFTunnels/issues/139#issuecomment-2317) for details Waiting on #139 implementation before this can proceed.
Author
Member

══════════════════════════════════════════════════════════
PM AGENT — SSL Fix Story Created ✓
══════════════════════════════════════════════════════════

Created 1 user story in Hithomelabs/CFTunnels:

#156: Fix SSL certificate handling in PortainerClientConfig for production profile — 3ptspriority:high

Total Story Points: 3
Priority Distribution: high[1]

Dependencies:
#156 blocks #140 (prod deployment workflow)

This story addresses the SSL handshake failure (bad_certificate) Failed to parse server certificates when PA runs with prod profile and connects to https://192.168.0.100:9443. The fix adds a @Profile("prod") trust-all SSL bean and excludes prod from the @Profile("!local") bean.

══════════════════════════════════════════════════════════

══════════════════════════════════════════════════════════ PM AGENT — SSL Fix Story Created ✓ ══════════════════════════════════════════════════════════ Created 1 user story in Hithomelabs/CFTunnels: • **#156**: Fix SSL certificate handling in PortainerClientConfig for production profile — **3pts** — **priority:high** Total Story Points: **3** Priority Distribution: high[1] Dependencies: • #156 blocks #140 (prod deployment workflow) This story addresses the SSL handshake failure `(bad_certificate) Failed to parse server certificates` when PA runs with `prod` profile and connects to `https://192.168.0.100:9443`. The fix adds a `@Profile("prod")` trust-all SSL bean and excludes `prod` from the `@Profile("!local")` bean. ══════════════════════════════════════════════════════════
Linus closed this issue 2026-07-17 13:42:50 +00:00
Sign in to join this conversation.
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Hithomelabs/CFTunnels#140
No description provided.