diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 1ffdef0..ec62ff4 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -1,7 +1,6 @@ -# Runs on pushes to main and on version tags (v*). -# -# Branch push (main): builds and pushes :latest + : -# Tag push (v1.2.0): builds and pushes :latest + : + :v1.2.0 +# Branch push (dev): builds and pushes :dev + : +# Branch push (main): builds and pushes :latest + : +# Tag push (v1.2.0): builds and pushes :latest + : + :v1.2.0 # # To cut a versioned release: # git tag v1.2.0 && git push origin v1.2.0 @@ -13,7 +12,7 @@ name: Build & push image on: push: - branches: [main] + branches: [main, dev] tags: ["v*"] paths: - "src/**" @@ -38,10 +37,13 @@ jobs: - name: Generate image tags id: tags run: | - TAGS="${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ github.sha }}" - if [[ "${{ github.ref }}" == refs/tags/* ]]; then - TAGS="$TAGS,${{ env.IMAGE }}:${{ github.ref_name }}" - echo "Releasing version ${{ github.ref_name }}" + TAGS="${{ env.IMAGE }}:${{ github.sha }}" + if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then + TAGS="$TAGS,${{ env.IMAGE }}:latest" + 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 echo "value=$TAGS" >> $GITHUB_OUTPUT