Add dev branch support to build workflow

dev push  → :dev + :<sha>
main push → :latest + :<sha>
tag push  → :latest + :<sha> + :<version>

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 21:17:53 -04:00
parent fbd5d04f6f
commit 02df3a4be4
+11 -9
View File
@@ -1,7 +1,6 @@
# Runs on pushes to main and on version tags (v*). # Branch push (dev): builds and pushes :dev + :<sha>
# # Branch push (main): builds and pushes :latest + :<sha>
# Branch push (main): builds and pushes :latest + :<sha> # Tag push (v1.2.0): builds and pushes :latest + :<sha> + :v1.2.0
# Tag push (v1.2.0): builds and pushes :latest + :<sha> + :v1.2.0
# #
# To cut a versioned release: # To cut a versioned release:
# git tag v1.2.0 && git push origin v1.2.0 # git tag v1.2.0 && git push origin v1.2.0
@@ -13,7 +12,7 @@ name: Build & push image
on: on:
push: push:
branches: [main] branches: [main, dev]
tags: ["v*"] tags: ["v*"]
paths: paths:
- "src/**" - "src/**"
@@ -38,10 +37,13 @@ jobs:
- name: Generate image tags - name: Generate image tags
id: tags id: tags
run: | run: |
TAGS="${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ github.sha }}" TAGS="${{ env.IMAGE }}:${{ github.sha }}"
if [[ "${{ github.ref }}" == refs/tags/* ]]; then if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
TAGS="$TAGS,${{ env.IMAGE }}:${{ github.ref_name }}" TAGS="$TAGS,${{ env.IMAGE }}:latest"
echo "Releasing version ${{ github.ref_name }}" elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
TAGS="$TAGS,${{ env.IMAGE }}:dev"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAGS="$TAGS,${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ github.ref_name }}"
fi fi
echo "value=$TAGS" >> $GITHUB_OUTPUT echo "value=$TAGS" >> $GITHUB_OUTPUT