From 358c4847a879004cc43bfe33096aebbbd8b3d1c5 Mon Sep 17 00:00:00 2001 From: Daniel Polito Date: Sun, 15 Nov 2026 18:56:03 -0300 Subject: [PATCH 1/3] Use shared Bash native-image CI from kool --- .github/workflows/ci-cd.yml | 93 ++++++++++++++++++++++++------------- README.md | 10 ++++ 2 files changed, 71 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index c9b2a41..47682e4 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -1,5 +1,4 @@ name: CI/CD - on: push: branches: [master] @@ -7,38 +6,55 @@ on: workflow_dispatch: schedule: - cron: '23 5 * * 1' - permissions: contents: read - +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: + checks: + runs-on: ubuntu-24.04 + outputs: + tags: ${{ steps.tags.outputs.tags }} + steps: + - uses: actions/checkout@v7 + - name: Check generated contexts + run: | + docker run --rm -v "$PWD:/app" fireworkweb/fwd:v1.0 fwd template + git diff --exit-code + - id: tags + run: echo "tags=$(jq -c '[.builds[].name]' fwd-template.json)" >> "$GITHUB_OUTPUT" build: - runs-on: ubuntu-latest + needs: checks + runs-on: ${{ matrix.platform.runner }} strategy: fail-fast: false matrix: version: [php, proxy, static] - + platform: + - {arch: amd64, runner: ubuntu-24.04} steps: - - name: Checkout code - uses: actions/checkout@v7.0.0 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4.2.0 - - - name: Build - run: | - docker buildx build \ - --pull --no-cache \ - --platform linux/amd64 \ - --output type=docker \ - --tag kooldev/nginx:${{ matrix.version }} \ - ${{ matrix.version }} - - - name: Tests - run: bash tests/smoke.sh "${{ matrix.version }}" "kooldev/nginx:${{ matrix.version }}" - - - name: Scan image + - uses: actions/checkout@v7 + - uses: kool-dev/kool/.github/actions/image-build@e06584d9fc7de69f4e3a9811d64a9f691f592b6b + with: + arch: ${{ matrix.platform.arch }} + - name: Build fresh image + id: image + uses: docker/build-push-action@v7 + with: + context: ${{ matrix.version }} + platforms: linux/${{ matrix.platform.arch }} + pull: true + no-cache: true + load: true + provenance: false + tags: kooldev/nginx:${{ matrix.version }} + - name: Smoke tests + env: + VARIANT: ${{ matrix.version }} + IMAGE: ${{ steps.image.outputs.imageid }} + run: bash tests/smoke.sh "$VARIANT" "$IMAGE" + - name: Scan tested image uses: anchore/scan-action@8576240a41341d866dbd7ebc72cd9fc0ef023f54 # v7.4.2 with: image: kooldev/nginx:${{ matrix.version }} @@ -47,7 +63,6 @@ jobs: only-fixed: false output-format: json output-file: grype-${{ matrix.version }}.json - - name: Retain vulnerability report if: always() uses: actions/upload-artifact@v7.0.2 @@ -55,14 +70,28 @@ jobs: name: grype-${{ matrix.version }} path: grype-${{ matrix.version }}.json if-no-files-found: warn - - - name: Login to DockerHub - uses: docker/login-action@v4.4.0 + - uses: kool-dev/kool/.github/actions/image-stage@e06584d9fc7de69f4e3a9811d64a9f691f592b6b if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-nginx' with: + canonical-repository: kool-dev/docker-nginx + default-branch: master + repository: kooldev/nginx + arch: ${{ matrix.platform.arch }} + group: ${{ matrix.version }} + images: '[{"tag":"${{ matrix.version }}","id":"${{ steps.image.outputs.imageid }}"}]' username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Push to DockerHub - if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-nginx' - run: docker push kooldev/nginx:${{ matrix.version }} + publish: + needs: [checks, build] + if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-nginx' + uses: kool-dev/kool/.github/workflows/image-publish.yml@e06584d9fc7de69f4e3a9811d64a9f691f592b6b + with: + canonical-repository: kool-dev/docker-nginx + default-branch: master + repository: kooldev/nginx + tags: ${{ needs.checks.outputs.tags }} + architectures: '["amd64"]' + tooling-ref: e06584d9fc7de69f4e3a9811d64a9f691f592b6b + secrets: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} diff --git a/README.md b/README.md index 581f96c..52189e0 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,16 @@ CI builds all three variants for **linux/amd64**. ARM is not supported by the bundled dockerize binary. Weekly Monday rebuilds pull the latest `nginx:alpine` and refresh Alpine packages without reusing build layers. +CI shares Bash/`jq` native-build, staging and publication tooling from +[kool-dev/kool](https://github.com/kool-dev/kool/tree/main/.github/actions), +pinned to one immutable commit. Builds, HTTP tests and Grype scans stay here. +After all three native jobs pass, one publisher validates current-run/attempt +metadata and promotes only the tested/scanned digests. Stable tags use indexes +containing only amd64 (no ARM support added). PRs, forks and feature branches cannot log in or +publish; release runs serialize and are not canceled. Rerun **all jobs** after a +failed release. There is no resume workflow or cross-attempt reuse, and updates +across the three tags are not atomic. + Run the same configuration and HTTP checks locally after building an image: ```sh From 143dbf2c11dd1ade020ccda473d29cdd86d96675 Mon Sep 17 00:00:00 2001 From: Daniel Polito Date: Mon, 16 Nov 2026 09:27:06 -0300 Subject: [PATCH 2/3] Pin shared image tooling from kool-dev/action --- .github/workflows/ci-cd.yml | 8 ++++---- README.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 47682e4..e3b2978 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -35,7 +35,7 @@ jobs: - {arch: amd64, runner: ubuntu-24.04} steps: - uses: actions/checkout@v7 - - uses: kool-dev/kool/.github/actions/image-build@e06584d9fc7de69f4e3a9811d64a9f691f592b6b + - uses: kool-dev/action/image-build@c1a0de73a81d63b9b1da74001afd60aa5573470a with: arch: ${{ matrix.platform.arch }} - name: Build fresh image @@ -70,7 +70,7 @@ jobs: name: grype-${{ matrix.version }} path: grype-${{ matrix.version }}.json if-no-files-found: warn - - uses: kool-dev/kool/.github/actions/image-stage@e06584d9fc7de69f4e3a9811d64a9f691f592b6b + - uses: kool-dev/action/image-stage@c1a0de73a81d63b9b1da74001afd60aa5573470a if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-nginx' with: canonical-repository: kool-dev/docker-nginx @@ -84,14 +84,14 @@ jobs: publish: needs: [checks, build] if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-nginx' - uses: kool-dev/kool/.github/workflows/image-publish.yml@e06584d9fc7de69f4e3a9811d64a9f691f592b6b + uses: kool-dev/action/.github/workflows/image-publish.yml@c1a0de73a81d63b9b1da74001afd60aa5573470a with: canonical-repository: kool-dev/docker-nginx default-branch: master repository: kooldev/nginx tags: ${{ needs.checks.outputs.tags }} architectures: '["amd64"]' - tooling-ref: e06584d9fc7de69f4e3a9811d64a9f691f592b6b + tooling-ref: c1a0de73a81d63b9b1da74001afd60aa5573470a secrets: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} diff --git a/README.md b/README.md index 52189e0..dac0ae9 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ bundled dockerize binary. Weekly Monday rebuilds pull the latest `nginx:alpine` and refresh Alpine packages without reusing build layers. CI shares Bash/`jq` native-build, staging and publication tooling from -[kool-dev/kool](https://github.com/kool-dev/kool/tree/main/.github/actions), +[kool-dev/action](https://github.com/kool-dev/action/blob/master/image-ci.md), pinned to one immutable commit. Builds, HTTP tests and Grype scans stay here. After all three native jobs pass, one publisher validates current-run/attempt metadata and promotes only the tested/scanned digests. Stable tags use indexes From cc037dfaab231f1af6a7f4998033845ca07e9ad6 Mon Sep 17 00:00:00 2001 From: Daniel Polito Date: Mon, 16 Nov 2026 09:51:58 -0300 Subject: [PATCH 3/3] Call the publisher action directly and trim repeated documentation --- .github/workflows/ci-cd.yml | 26 +++++++++++++------------- README.md | 13 ++++--------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index e3b2978..af3f16d 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -35,7 +35,7 @@ jobs: - {arch: amd64, runner: ubuntu-24.04} steps: - uses: actions/checkout@v7 - - uses: kool-dev/action/image-build@c1a0de73a81d63b9b1da74001afd60aa5573470a + - uses: kool-dev/action/image-build@6a6d04e8d1e1c66afc178e32c7d77d76169c7717 with: arch: ${{ matrix.platform.arch }} - name: Build fresh image @@ -70,7 +70,7 @@ jobs: name: grype-${{ matrix.version }} path: grype-${{ matrix.version }}.json if-no-files-found: warn - - uses: kool-dev/action/image-stage@c1a0de73a81d63b9b1da74001afd60aa5573470a + - uses: kool-dev/action/image-stage@6a6d04e8d1e1c66afc178e32c7d77d76169c7717 if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-nginx' with: canonical-repository: kool-dev/docker-nginx @@ -84,14 +84,14 @@ jobs: publish: needs: [checks, build] if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-nginx' - uses: kool-dev/action/.github/workflows/image-publish.yml@c1a0de73a81d63b9b1da74001afd60aa5573470a - with: - canonical-repository: kool-dev/docker-nginx - default-branch: master - repository: kooldev/nginx - tags: ${{ needs.checks.outputs.tags }} - architectures: '["amd64"]' - tooling-ref: c1a0de73a81d63b9b1da74001afd60aa5573470a - secrets: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + runs-on: ubuntu-24.04 + steps: + - uses: kool-dev/action/image-publish@6a6d04e8d1e1c66afc178e32c7d77d76169c7717 + with: + canonical-repository: kool-dev/docker-nginx + default-branch: master + repository: kooldev/nginx + tags: ${{ needs.checks.outputs.tags }} + architectures: '["amd64"]' + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} diff --git a/README.md b/README.md index dac0ae9..4aadd82 100644 --- a/README.md +++ b/README.md @@ -62,15 +62,10 @@ CI builds all three variants for **linux/amd64**. ARM is not supported by the bundled dockerize binary. Weekly Monday rebuilds pull the latest `nginx:alpine` and refresh Alpine packages without reusing build layers. -CI shares Bash/`jq` native-build, staging and publication tooling from -[kool-dev/action](https://github.com/kool-dev/action/blob/master/image-ci.md), -pinned to one immutable commit. Builds, HTTP tests and Grype scans stay here. -After all three native jobs pass, one publisher validates current-run/attempt -metadata and promotes only the tested/scanned digests. Stable tags use indexes -containing only amd64 (no ARM support added). PRs, forks and feature branches cannot log in or -publish; release runs serialize and are not canceled. Rerun **all jobs** after a -failed release. There is no resume workflow or cross-attempt reuse, and updates -across the three tags are not atomic. +CI uses [shared Bash/`jq` actions](https://github.com/kool-dev/action/blob/master/image-ci.md), +pinned in the workflow. Builds, HTTP tests and Grype scans stay here. After all +three jobs pass, one publisher promotes the tested/scanned digests as amd64-only +indexes. See the shared release rules for publication guards and retry behavior. Run the same configuration and HTTP checks locally after building an image: