Skip to main content

Command menu

Jump to a page or search the catalog

Trusted Solution

GitHub Actions

Docker Build, Scan and Push Workflows for GitHub Actions with Trivy and Cosign

5 GitHub Actions workflows: multi-arch Docker builds, Trivy scans and gates, push to GHCR, Docker Hub or ECR, cosign signing, registry cleanup.

$13.00

What you get: 1 file · 14.56 KB · ZIP

See purchase options

Product description

Container pipelines for GitHub Actions that build, scan, push and sign your Docker images, written so you can drop them into a repository and ship on the next push. GitHub Container Registry works with no secrets at all; Docker Hub and Amazon ECR are optional.

What is inside

  • docker-publish.yml: pull requests build linux/amd64 and scan it without pushing. Main and version tags build linux/amd64 and linux/arm64, push to GHCR (and Docker Hub when configured), attach an SBOM and max-mode provenance, scan the pushed digest with Trivy, upload SARIF to code scanning, fail on fixable CRITICAL findings, and sign the digest with cosign keyless signing.
  • Tags from docker/metadata-action: branch, pr-N, 1.2.3, 1.2, 1, sha-abc1234 and latest on the default branch.
  • docker-lint.yml: hadolint and Trivy misconfiguration scan whenever a Dockerfile changes.
  • docker-rescan.yml: nightly rescan of the published image so new CVEs show up without a rebuild.
  • docker-ecr.yml: Amazon ECR via GitHub OIDC (no stored AWS keys); scans before pushing, so a failed gate ships nothing.
  • ghcr-cleanup.yml: weekly removal of untagged GHCR versions, keeps the newest 20.
  • aws/: IAM trust policy, least-privilege ECR push policy and setup-oidc.sh that creates the OIDC provider, an ECR repository with scan on push and immutable tags, and the role.
  • Example multi-stage non-root Dockerfile with a HEALTHCHECK that needs no curl, a tiny Node.js service, .dockerignore, .hadolint.yaml and a commented .trivyignore.

Tested

  • All 5 workflows pass actionlint 1.7.12 with shellcheck enabled; setup-oidc.sh passes shellcheck.
  • IAM policy files are valid JSON; the example service and its healthcheck were run locally.
  • Pinned versions: checkout v4, docker setup-qemu v3, setup-buildx v3, login v3, metadata v5, build-push v6, trivy-action v0.36.0, codeql upload-sarif v3, cosign-installer v3, hadolint-action v3.1.0, configure-aws-credentials v4, amazon-ecr-login v2, delete-package-versions v5.

Requirements

  • A GitHub repository with Actions and a Dockerfile (path and context are variables at the top of each workflow).
  • Code scanning upload needs a public repository or GitHub Code Security; without it, remove one step and the gate still works.
  • ECR: an AWS account and the AWS CLI for the one-time setup script.

Setup

Copy the workflows and config files, push to main, and the image appears under Packages. The README covers Docker Hub, ECR, verifying signatures with cosign and accepting a CVE.

Licence

Commercial licence: use in unlimited own and client projects. You may not resell or redistribute the workflow pack itself.

What you get

1 file · 14.56 KB

  • Docker-Build-Scan-Push-Workflows.zipZIP · 14.56 KB
LicenseCommercial use allowed
Package checkPassed

Getly opened the uploaded files and found nothing that would stop them opening. It is not a virus scan or a quality rating.

PublishedDec 2, 2026
File size14.56 KB
File formatZIP
Versionv1.0

Tags

github-actionsdockertrivycosignghcraws-ecrdevsecopsci-cdcontainers
N
NeonAnvil
Pro SellerGetly Trusted

Frequently asked questions

Do I get access instantly?

Yes. This is a digital product - you can download it right after checkout, straight from your library.

Can I use it for commercial projects?

Yes. Commercial use is allowed: use it in your own business and in things you sell. You may not resell or redistribute the file itself.

What's your refund policy?

You can request a refund within 30 days. If something isn't right, request it from your order and the Getly team reviews it.

What file formats and sizes will I get?

You'll download 1 file - ZIP - 14.56 KB in total.

Do I get free updates?

Yes - when the seller ships a new version, you can re-download the latest files from your library at no extra cost. Check the changelog for recent updates.

Price

$13.00