Add testnet CI/CD workflow, consolidate production workflows (Option A) #73

Open
peter wants to merge 1 commit from feature/cicd-option-a into development
Owner
  • Add deploy-testnet.yml: triggers on v*-rc* tags, builds image, pushes to
    registry, pulls and restarts on testnet VM via SSH, runs health check
  • Update deploy-production.yml: consolidate with build-container.yml into
    single workflow for release tags (excludes -rc), includes build, push,
    k8s deploy, health check, smoke tests, and release creation
  • Remove build-container.yml: redundant, functionality merged into
    deploy-production.yml

CI/CD flow:

  • Dev: push to development → deploy-dev.yml (rsync to dev VM)
  • Testnet: push v*-rc* tag → deploy-testnet.yml (docker pull on testnet VM)
  • Production: push v* tag → deploy-production.yml (k8s set image)

New secret required: TESTNET_SSH_KEY (SSH key for testnet VM, port 34022)

- Add deploy-testnet.yml: triggers on v*-rc* tags, builds image, pushes to registry, pulls and restarts on testnet VM via SSH, runs health check - Update deploy-production.yml: consolidate with build-container.yml into single workflow for release tags (excludes -rc), includes build, push, k8s deploy, health check, smoke tests, and release creation - Remove build-container.yml: redundant, functionality merged into deploy-production.yml CI/CD flow: - Dev: push to development → deploy-dev.yml (rsync to dev VM) - Testnet: push v*-rc* tag → deploy-testnet.yml (docker pull on testnet VM) - Production: push v* tag → deploy-production.yml (k8s set image) New secret required: TESTNET_SSH_KEY (SSH key for testnet VM, port 34022)
Add testnet CI/CD workflow, consolidate production workflows (Option A)
All checks were successful
Test / check (pull_request) Successful in 6m45s
53a070a441
- Add deploy-testnet.yml: triggers on v*-rc* tags, builds image, pushes to
  registry, pulls and restarts on testnet VM via SSH, runs health check
- Update deploy-production.yml: consolidate with build-container.yml into
  single workflow for release tags (excludes -rc), includes build, push,
  k8s deploy, health check, smoke tests, and release creation
- Remove build-container.yml: redundant, functionality merged into
  deploy-production.yml

CI/CD flow:
  - Dev: push to development → deploy-dev.yml (rsync to dev VM)
  - Testnet: push v*-rc* tag → deploy-testnet.yml (docker pull on testnet VM)
  - Production: push v* tag → deploy-production.yml (k8s set image)

New secret required: TESTNET_SSH_KEY (SSH key for testnet VM, port 34022)
@ -96,2 +156,3 @@
env:
FORGEJO_TOKEN: ${{ github.token }}
run: |
./scripts/gateway-smoke-test.sh https://ledger.dev.projectmycelium.com
Member

Was this intentional?

Was this intentional?
@ -0,0 +121,4 @@
# Wait for healthy
echo 'Waiting for container to be healthy...'
for i in \$(seq 1 30); do
STATUS=\$(sudo docker inspect --format='{{.State.Health.Status}}' deploy-portal-1 2>/dev/null || echo 'starting')
Member

The current Dockerfile has no HEALTHCHECK directive, so .State.Health.Status would be empty/missing. The check would fall through to the external curl health check, which does work but the docker inspect loop is dead code and wasting a minute of waiting.

The current Dockerfile has no HEALTHCHECK directive, so `.State.Health.Status` would be empty/missing. The check would fall through to the external curl health check, which does work but the docker inspect loop is dead code and wasting a minute of waiting.
sameh-farouk left a comment
Member

See please here #72 (comment)

See please here https://forge.ourworld.tf/mycelium/www_migrate_mycelium/issues/72#issuecomment-18215
@ -21,1 +22,4 @@
tags:
- "v*"
- "!v*-rc*"
workflow_dispatch:
Member

I would remove workflow_dispatch from testnet entirely.
The intended flow is: push a tag → deploy. If you need to redeploy a version, push the same tag again (force) or delete and recreate it. Manual dispatch adds complexity for a use case that the tag flow already covers.

I would remove workflow_dispatch from testnet entirely. The intended flow is: push a tag → deploy. If you need to redeploy a version, push the same tag again (force) or delete and recreate it. Manual dispatch adds complexity for a use case that the tag flow already covers.
Member

Attached patch applies on top of this PR's branch:

  • deploy-dev.yml: adds a build-container job that pushes : after smoke tests pass
  • deploy-testnet.yml: replaces docker build with docker pull : + retag, removes -rc requirement, drops workflow_dispatch
  • deploy-production.yml: triggers on main push instead of tags, replaces docker build with docker pull : + retag, uses git describe to find the version
Attached patch applies on top of this PR's branch: - **deploy-dev.yml:** adds a build-container job that pushes :<commit-sha> after smoke tests pass - **deploy-testnet.yml:** replaces docker build with docker pull :<sha> + retag, removes -rc requirement, drops workflow_dispatch - **deploy-production.yml:** triggers on main push instead of tags, replaces docker build with docker pull :<version> + retag, uses git describe to find the version
All checks were successful
Test / check (pull_request) Successful in 6m45s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/cicd-option-a:feature/cicd-option-a
git switch feature/cicd-option-a

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch development
git merge --no-ff feature/cicd-option-a
git switch feature/cicd-option-a
git rebase development
git switch development
git merge --ff-only feature/cicd-option-a
git switch feature/cicd-option-a
git rebase development
git switch development
git merge --no-ff feature/cicd-option-a
git switch development
git merge --squash feature/cicd-option-a
git switch development
git merge --ff-only feature/cicd-option-a
git switch development
git merge feature/cicd-option-a
git push origin development
Sign in to join this conversation.
No reviewers
No labels
No milestone
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
mycelium/www_migrate_mycelium!73
No description provided.