Skip to content

ci(release): add Deploy backend workflow - #657

Merged
MRmarioruci merged 10 commits into
release-2-deploy-fefrom
release-3-deploy-be
Sep 4, 2026
Merged

ci(release): add Deploy backend workflow#657
MRmarioruci merged 10 commits into
release-2-deploy-fefrom
release-3-deploy-be

Conversation

@MRmarioruci

@MRmarioruci MRmarioruci commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Phase 3 of 4. Stacked on #656.

Adds the Deploy backend workflow_dispatch, a deploy-backend composite action, and scripts/deploy-backend.

You tick station, upgrader, or control-panel and run it. The workflow's two jobs each call the composite action, which installs the toolchain, materialises the key from the BACKEND_IDENTITY_PEM environment secret, and then calls scripts/deploy-backend once per target. All of the real work lives in the script, so CI and an operator on a laptop run the same code rather than two copies that drift. The script resolves the newest release tag, downloads the wasm, verifies it against the .sha256 published beside it, loads the key into a throwaway dfx home, and dispatches: station and upgrader go through orbit-cli registry publish, which only makes the version available (each production station still self-upgrades on its own admins' approval, and publishing station also publishes its upgrader dependency); control-panel is a direct dfx canister install --mode upgrade of the one canister, so nothing buffers it.

The production job is off by default and has no key. Production backends are deployed with scripts/deploy-backend --op, which keeps that credential out of this repo. The job is kept so the wiring exists if that is revisited; with no key it fails fast with a pointer.

Two defects surfaced while moving the logic out of the action, both fixed here. orbit-cli resolves the identity pem from homedir() and ignores DFX_CONFIG_ROOT, so the isolated dfx root the action set up would have left registry publish unable to find the identity dfx had just imported; the script exports HOME alongside it. And the registry entry's version label comes from cargo metadata rather than from the artifact, so deploying from a stale checkout would publish the right wasm under the wrong version; the script compares the two and refuses, naming the tag to check out.

The backend identity must be both a registry admin and a control-panel controller. Base of this PR is #656; review the stack in order.

@zeropath-ai

zeropath-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 280c239.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► .github/actions/deploy-backend/action.yaml
    Add Deploy backend action for Orbit backend deployment
► .github/workflows/release-deploy-backend.yaml
    Add release workflow to deploy backend to playground and production (optional)
New Feature ► scripts/deploy-backend
    Add script to deploy Orbit backend (station/upgrader/control-panel) with signing and verification

@MRmarioruci MRmarioruci changed the title ci: add Deploy backend workflow ci(release): add Deploy backend workflow Sep 1, 2026
@MRmarioruci
MRmarioruci requested a lite review from Copilot September 1, 2026 13:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the backend half of the release deployment pipeline by introducing a manually-triggered workflow that deploys released backend WASM artifacts to playground first and (optionally) promotes the same selection to production behind a GitHub Environment approval gate.

Changes:

  • Introduces a Deploy backend workflow_dispatch workflow that runs playground then production (gated) deployments.
  • Adds a deploy-backend composite action that installs required tooling, imports a deployment identity, downloads the latest released WASMs, and deploys via either orbit-cli registry publish (station/upgrader) or dfx canister install --mode upgrade (control-panel).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/release-deploy-backend.yaml New workflow to deploy selected backend components to playground and optionally promote to production with environment approval.
.github/actions/deploy-backend/action.yaml New composite action encapsulating backend deployment logic (tooling setup, identity import, release artifact download, and deployment commands).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/actions/deploy-backend/action.yaml Outdated
Comment thread .github/actions/deploy-backend/action.yaml Outdated
Comment thread .github/workflows/release-deploy-backend.yaml
@MRmarioruci
MRmarioruci force-pushed the release-3-deploy-be branch 2 times, most recently from ab9cecb to 32dfc90 Compare September 2, 2026 10:27
@MRmarioruci
MRmarioruci force-pushed the release-3-deploy-be branch 4 times, most recently from 69f3ebb to a49ad45 Compare September 4, 2026 08:04
MRmarioruci and others added 9 commits September 4, 2026 11:48
Phase 3 (backend) of the release. A workflow_dispatch that publishes
station/upgrader to the control-panel registry, or upgrades the control-panel
canister in place, on playground then production behind the approval gate.
Shared logic lives in a deploy-backend composite action.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Pin dfinity/setup-dfx (was @main, a moving branch with no tags) and
actions/checkout to immutable commit SHAs, to make the privileged deploy
workflow reproducible and reduce supply-chain exposure.
… checksum)

Serialize deploy runs with a concurrency group, drop persisted git
credentials on the download-only checkouts, and verify each downloaded wasm
against its published .sha256 before publishing or upgrading.
… one path

The backend deploy logic lived inside the composite action, so it could
only ever run in CI. Move it into scripts/deploy-backend, matching
scripts/deploy-app's shape (--pem or --op), and have the action call it
once per target. Production keys can now stay off CI entirely.

Two defects fall out of the move. orbit-cli resolves the identity pem
from homedir() and ignores DFX_CONFIG_ROOT, so the isolated dfx root the
action set up would have made registry publish fail to find the identity
dfx had just imported; the script exports HOME alongside it. And the
registry entry's version label comes from cargo metadata rather than the
artifact, so a stale checkout would publish the right wasm under the
wrong version; the script compares the two and refuses.
Same two fixes as the frontend workflow: the string comparison against a
typed boolean input left the production job unreachable, and the signing
key is now named per environment rather than shared.
…cated tag

Same unanchored version pattern as the frontend script: a pre-release tag
matched as its stable prefix and resolved to a tag that does not exist.
@MRmarioruci
MRmarioruci merged commit 914a39a into main Sep 4, 2026
33 checks passed
@MRmarioruci
MRmarioruci deleted the release-3-deploy-be branch September 4, 2026 13:28
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.

3 participants