|
|
||
|---|---|---|
| cosign-sign | ||
| docker-build | ||
| trivy-scan | ||
| cosign.pub | ||
| README.md | ||
ci/actions
Composite actions for Forgejo Actions on git.tlyng.no. Reference them by full URL
and a version tag (short names like actions/checkout resolve to data.forgejo.org):
- uses: https://git.tlyng.no/ci/actions/docker-build@v2
v2 moves with compatible changes; pin v2.x.y or a commit SHA for strictness.
(v1 still has the removed flox action.)
docker-build
Logs in, builds and pushes using the runner's Docker.
- uses: https://git.tlyng.no/ci/actions/docker-build@v2
with:
image: oci.tlyng.no/myapp
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
Tags default to <commit sha> latest; push: "false" only builds; build-args takes one
KEY=VALUE per line.
Output digest is the pushed image by digest, for the steps below.
trivy-scan and cosign-sign
Scan the pushed image, then sign it only if the scan passed. zot verifies the
signature (public key cosign.pub here, uploaded to zot's trust extension) and
shows the image as signed; it also runs its own Trivy scans for the UI.
An image that fails the scan stays in the registry unsigned.
runs-on: go # or base, rust, node (images from ci/images)
steps:
- uses: actions/checkout@v4
- uses: https://git.tlyng.no/ci/actions/docker-build@v2
id: img
with:
image: oci.tlyng.no/myapp
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- uses: https://git.tlyng.no/ci/actions/trivy-scan@v2
with:
image: ${{ steps.img.outputs.digest }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- uses: https://git.tlyng.no/ci/actions/cosign-sign@v2
with:
image: ${{ steps.img.outputs.digest }}
key: ${{ secrets.COSIGN_PRIVATE_KEY }}
key-password: ${{ secrets.COSIGN_PASSWORD }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
trivy-scan inputs: severity (default HIGH,CRITICAL), ignore-unfixed (default true),
exit-code (0 to report without failing).
Secrets REGISTRY_USERNAME/REGISTRY_PASSWORD (zot user ci) and
COSIGN_PRIVATE_KEY/COSIGN_PASSWORD exist on the ci org and on user torkel.
Rotating the key: cosign generate-key-pair, update both secrets and cosign.pub,
upload the new public key to zot.