Skip to content

Commit 0008277

Browse files
Fix workflow to support dev branch builds without pushing.
The metadata-action wasn't generating tags for dev branch, causing builds to fail. Added tag pattern for dev branch and updated push conditions to only push on main/tags, not dev. Changes: - Added type=ref tag for dev branch (generates 'dev' tag) - Updated push condition to exclude dev branch - Skip Docker Hub login/manifest/description steps for dev builds - Dev builds now validate only, no Docker Hub push Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent cda66ef commit 0008277

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/docker-image.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ jobs:
3535
with:
3636
images: portableprogrammer/status-light
3737
tags: |
38-
# Tag PRs with 'edge'
38+
# Dev branch gets 'dev' tag (for local builds, not pushed)
39+
type=ref,event=branch,enable=${{ github.ref == 'refs/heads/dev' }}
40+
# Main branch gets 'edge' tag
3941
type=edge,branch=main
4042
# Tag releases with semver
4143
type=semver,pattern={{version}}
@@ -54,7 +56,7 @@ jobs:
5456
uses: docker/setup-buildx-action@v3 # 2026-02-05: v3.7.1
5557

5658
- name: Docker Hub login
57-
if: github.event_name != 'pull_request'
59+
if: github.event_name != 'pull_request' && github.ref != 'refs/heads/dev'
5860
uses: docker/login-action@v3 # 2026-02-05: v3.3.0
5961
with:
6062
username: ${{ secrets.DOCKER_USERNAME }}
@@ -67,7 +69,7 @@ jobs:
6769
context: .
6870
file: ./Dockerfiles/Dockerfile
6971
platforms: linux/amd64,linux/arm/v7,linux/arm64
70-
push: ${{ github.event_name != 'pull_request' }}
72+
push: ${{ github.event_name != 'pull_request' && github.ref != 'refs/heads/dev' }}
7173
tags: ${{ steps.meta.outputs.tags }}
7274
labels: ${{ steps.meta.outputs.labels }}
7375
# GitHub Actions cache for faster builds
@@ -88,7 +90,7 @@ jobs:
8890
continue-on-error: true
8991

9092
- name: Verify multi-arch manifest
91-
if: github.event_name != 'pull_request'
93+
if: github.event_name != 'pull_request' && github.ref != 'refs/heads/dev'
9294
run: |
9395
docker buildx imagetools inspect ${{ steps.meta.outputs.tags }} | tee manifest.txt
9496
echo "## Multi-Architecture Manifest" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)