62 - Build the production image on tags only

This commit is contained in:
myrmidex 2026-08-16 12:07:16 +02:00
parent 45e1a0a4dd
commit 27ca47997f

View file

@ -1,8 +1,9 @@
name: Build and Push Docker Image name: Build and Push Docker Image
on: on:
# Tags only. A release merges to main and is tagged at the same commit, so a
# branch trigger here would build and push the image twice.
push: push:
branches: [main]
tags: ['v*'] tags: ['v*']
jobs: jobs:
@ -30,12 +31,8 @@ jobs:
- name: Determine tags - name: Determine tags
id: meta id: meta
run: | run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
TAG="${{ github.ref_name }}" TAG="${{ github.ref_name }}"
echo "tags=forge.lvl0.xyz/lvl0/incr:${TAG},forge.lvl0.xyz/lvl0/incr:latest" >> $GITHUB_OUTPUT echo "tags=forge.lvl0.xyz/lvl0/incr:${TAG},forge.lvl0.xyz/lvl0/incr:latest" >> $GITHUB_OUTPUT
else
echo "tags=forge.lvl0.xyz/lvl0/incr:latest" >> $GITHUB_OUTPUT
fi
- name: Build and push - name: Build and push
uses: https://data.forgejo.org/docker/build-push-action@v5 uses: https://data.forgejo.org/docker/build-push-action@v5