Composite actions shared by workflows
Find a file
Torkel Lyng f4cdfd05dc feat!: drop the flox action; docker-build gains build-args
BREAKING CHANGE: the flox action is gone along with the ci/build image.
2026-12-01 22:07:10 +01:00
cosign-sign cosign-sign: no-tlog signing config instead of --tlog-upload=false (cosign v3) 2026-12-01 21:49:18 +01:00
docker-build feat!: drop the flox action; docker-build gains build-args 2026-12-01 22:07:10 +01:00
trivy-scan trivy-scan and cosign-sign actions; docker-build outputs the pushed digest 2026-12-01 21:38:42 +01:00
cosign.pub trivy-scan and cosign-sign actions; docker-build outputs the pushed digest 2026-12-01 21:38:42 +01:00
README.md feat!: drop the flox action; docker-build gains build-args 2026-12-01 22:07:10 +01:00

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.