diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index 3f10103..95aab0d 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -68,6 +68,11 @@ jobs: username: ${{ gitea.actor }} password: ${{ secrets.REGISTRY_TOKEN }} + # Uncached builds (the callers' weekly rebuild) also get a YYYYMMDD tag: + # they overwrite latest/main/ with an image of the same commit, so + # the date tag is what's left to roll back to. Keyed on no-cache rather + # than type=schedule, because a called workflow only ever sees the + # event workflow_call. - name: Extract metadata id: meta uses: docker/metadata-action@v6 @@ -78,6 +83,7 @@ jobs: type=semver,pattern={{version}} type=sha,prefix=,format=short type=raw,value=latest,enable={{is_default_branch}} + type=raw,value={{date 'YYYYMMDD'}},enable=${{ inputs.no-cache }} # Each platform is built into the local Docker daemon on its own (a # multi-platform image can't be loaded), scanned against the Trivy server, diff --git a/README.md b/README.md index ccad3d6..ca28c22 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ For x64 and arm64 (Raspberry Pi), add: | `context` | `.` | Docker build context. | | `file` | `/Dockerfile` | Path to the Dockerfile. | | `build-args` | | Extra build args, one `NAME=value` per line, e.g. `APP_VERSION=${{ gitea.sha }}`. Used for both the scanned and the pushed build. | -| `no-cache` | `false` | Build without cache. Use `${{ gitea.event_name == 'schedule' }}` so weekly rebuilds pick up new packages. | +| `no-cache` | `false` | Build without cache. Use `${{ gitea.event_name == 'schedule' }}` so weekly rebuilds pick up new packages. Uncached builds are also tagged `YYYYMMDD` (UTC), which keeps each week's image as a rollback point. | | `severity` | `CRITICAL,HIGH` | Severities that fail the build. Vulnerabilities without a fixed version never fail it. | | `runs-on` | `linux-amd64` | Runner label. |