Skip to content

feat: add deploy job to Zarf workflow with pre/post verification - #7

Merged
RuBiCK merged 3 commits into
mainfrom
feat/zarf-deploy-step
Jun 15, 2026
Merged

feat: add deploy job to Zarf workflow with pre/post verification#7
RuBiCK merged 3 commits into
mainfrom
feat/zarf-deploy-step

Conversation

@RuBiCK

@RuBiCK RuBiCK commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a deploy job to zarf-package.yml that runs automatically after every successful package build on main.

What it does:

  • Downloads the Zarf tarball artifact from the package job
  • Captures pre-deploy state (running image tags) in the step summary
  • Runs zarf package deploy against the target cluster
  • Applies post-deploy fixes (namespace label, registry secret copy, rollout restart)
  • Asserts both deployments are running the expected sha-XXXXXXX tag — the step fails if there's a mismatch

Architecture note (TODOs documented inline)

The deploy job as written assumes the runner can reach the cluster directly (e.g. via a self-hosted runner or VPN). For a real air-gap two approaches are documented as TODO comments in the workflow:

  • Option A — Object storage: Upload tarball to S3/compatible, grant the target environment read-only access, pull from there. No public internet needed on the cluster side.
  • Option B — USB transfer: Download artifact from GitHub Actions, copy to USB alongside the Zarf binary and init package, deploy offline. See ZARF.md § Air-Gap USB Deployment.

Required secret

KUBECONFIG_B64 — base64-encoded kubeconfig with access to the target cluster:

base64 -i ~/.kube/k3s-lab.yaml | tr -d '\n'

E2E validation (done manually this session)

Before After
Backend image localhost:5001/.../backend:dev ...ecr.../backend:sha-13b0a93
/api/items count 3 items 4 items (Item Delta ✓)
Frontend subtitle k3s ready k3s ready · E2E validation ✓

🤖 Generated with Claude Code

Rubén and others added 3 commits June 15, 2026 11:23
Adds a second job 'deploy' that runs after the package job on every
workflow_run trigger (post-merge to main). It:

1. Downloads the Zarf tarball artifact produced by the package job
2. Captures the pre-deploy state (running image tags) as a step summary
3. Deploys the tarball with `zarf package deploy`
4. Applies post-deploy fixes (namespace label, registry secret, rollout restart)
5. Asserts both deployments are running the expected sha- tag — fails if not

Also documents the two recommended approaches for true air-gap delivery
(object storage handoff and USB transfer) as inline TODO comments.

Requires KUBECONFIG_B64 secret: base64-encoded kubeconfig with access to
the target cluster.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Runs `zarf dev lint` on every PR that modifies zarf.yaml or helm/airgapped-demo/.
Validates schema, chart paths, variable declarations, and template syntax
without pulling images or requiring registry credentials.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@RuBiCK
RuBiCK merged commit eee9121 into main Jun 15, 2026
2 checks passed
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