Skip to content

fix: simplify Docker tagging — 'main' for branch, full tags for releases#95

Merged
ChrisRomp merged 3 commits into
mainfrom
chrisromp/docker-tag-strategy
May 18, 2026
Merged

fix: simplify Docker tagging — 'main' for branch, full tags for releases#95
ChrisRomp merged 3 commits into
mainfrom
chrisromp/docker-tag-strategy

Conversation

@ChrisRomp
Copy link
Copy Markdown
Owner

@ChrisRomp ChrisRomp commented May 18, 2026

Summary

Simplifies the Docker image tagging strategy to eliminate tag overlap and reduce unnecessary builds on main branch pushes.

Before

  • Main branch pushes built all 3 resolutions and tagged the default as latest
  • The bare 1600x960 tag was overwritten by both main and release builds

After

Trigger Builds Tags
Push to main Default resolution only (1600x960) main
Release v1.2.3 All resolutions Default: latest, v1.2.3, 1600x960, v1.2.3-1600x960
Others: <resolution>, v1.2.3-<resolution>
PR All (no push)

Changes

  • Added job-level if to skip non-default resolution matrix entries on non-release builds
  • Simplified tag generation: main pushes get a single main tag; releases get full version/resolution tagging
  • latest now only reflects GitHub releases, not branch builds

Main branch pushes now only build the default resolution (1600x960)
and tag it as 'main'. Release builds (version tags) produce all
resolutions with full tagging: latest, version, resolution, and
version-resolution tags.

This eliminates the overlap where resolution-only tags were
overwritten by both main and release builds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ChrisRomp ChrisRomp force-pushed the chrisromp/docker-tag-strategy branch from 86c82af to 445a7b9 Compare May 18, 2026 18:32
@ChrisRomp ChrisRomp changed the title fix: use 'main' tag for branch builds, reserve 'latest' for releases fix: simplify Docker tagging — 'main' for branch, full tags for releases May 18, 2026
@ChrisRomp ChrisRomp self-assigned this May 18, 2026
@ChrisRomp ChrisRomp requested a review from Copilot May 18, 2026 18:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Docker publishing workflow to simplify image tagging and reduce non-release branch builds.

Changes:

  • Adds matrix filtering intended to build only the default resolution outside release tags.
  • Changes Docker tag generation so non-release builds use :main.
  • Keeps full resolution/version tagging for release tag builds.
Show a summary per file
File Description
.github/workflows/docker-publish.yml Updates build job filtering and Docker tag generation behavior.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 3

Comment thread .github/workflows/docker-publish.yml Outdated
Comment thread .github/workflows/docker-publish.yml Outdated
Comment thread .github/workflows/docker-publish.yml Outdated
- Remove invalid job-level 'if' that referenced matrix context
- All resolutions always build (PRs get full validation coverage)
- Push decisions are centralized in tag generation step output
- workflow_dispatch from non-main branches no longer overwrites :main
- Sign step gated on push output for consistency

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread .github/workflows/docker-publish.yml Outdated
Comment thread .github/workflows/docker-publish.yml
- Move tag generation step early (before cosign/login/buildx setup)
- Add 'build' output to skip non-default resolution builds on main/dispatch
- Gate cosign install and registry login on push==true (not just non-PR)
- Gate buildx setup, artifact download, and docker build on build==true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ChrisRomp ChrisRomp merged commit 216c9b9 into main May 18, 2026
4 checks passed
@ChrisRomp ChrisRomp deleted the chrisromp/docker-tag-strategy branch May 18, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants