No description
Find a file
2026-10-02 14:45:06 +03:00
scripts Centralize staged deployment script in shared action 2026-10-02 14:45:06 +03:00
action.yml Centralize staged deployment script in shared action 2026-10-02 14:45:06 +03:00
README.md Centralize staged deployment script in shared action 2026-10-02 14:45:06 +03:00

Docker Build Push Deploy Action

This composite action builds a Docker image from the calling repository, pushes the commit tag to the Forgejo Container Registry, and optionally deploys it over SSH.

The shared deployment implementation lives in scripts/deploy-container.sh. The action streams that file to the deployment host and runs it there, so projects using this action share one versioned deployment script. Registry credentials are sent over SSH input and used with a temporary Docker config on the host.

For images with a Docker HEALTHCHECK, deployment starts a candidate using temporary published ports and checks it before switching. The previous container is retained until the replacement passes its health check and is restored if startup fails. For runtime arguments that mount shared storage, candidate preflight is skipped to avoid running two containers against the same data; the production health check and rollback still run.

Images without a Docker HEALTHCHECK receive a running-state check only. --network host is rejected during candidate preflight because it cannot safely run alongside the current container. Runtime arguments are parsed with shell-style quoting and passed as argument arrays; they are not evaluated as shell code.