publish builds on release

This commit is contained in:
Vladimir Dubrovin committed 2026-05-31 15:29:11 +03:00
1 parent 34e9c453fa
commit 997671ee16
9 files changed
+110 -49

No files matched your search

+9 -13
View File
@@ -1,10 +1,8 @@
name: Build Docker images (GHCR)
on:
push:
branches: [master]
paths:
- 'RELEASE'
release:
types: [published]
workflow_dispatch:
env:
@@ -25,19 +23,20 @@ jobs:
- name: Determine tags
id: tags
env:
REF: ${{ github.ref }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
IMAGE: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
run: |
if [[ "$REF" == refs/tags/* ]]; then
RELEASE=$(cat RELEASE)
if [[ "$RELEASE_TAG" != "" ]]; then
RELEASE="${RELEASE_TAG#v}"
echo "minimal=${IMAGE}:${RELEASE}.minimal,${IMAGE}:minimal" >> "$GITHUB_OUTPUT"
echo "busybox=${IMAGE}:${RELEASE}.busybox,${IMAGE}:busybox" >> "$GITHUB_OUTPUT"
echo "full=${IMAGE}:${RELEASE},${IMAGE}:latest" >> "$GITHUB_OUTPUT"
else
DATETIME=$(date +%d%m%y%H%M%S)
echo "minimal=${IMAGE}:${DATETIME}-devel.minimal,${IMAGE}:devel.minimal" >> "$GITHUB_OUTPUT"
echo "busybox=${IMAGE}:${DATETIME}-devel.busybox,${IMAGE}:devel.busybox" >> "$GITHUB_OUTPUT"
echo "full=${IMAGE}:${DATETIME}-devel,${IMAGE}:devel" >> "$GITHUB_OUTPUT"
BRANCH=$(echo "${GITHUB_REF#refs/heads/}" | tr "/" "-")
echo "minimal=${IMAGE}:${DATETIME}-${BRANCH}.minimal,${IMAGE}:${BRANCH}.minimal" >> "$GITHUB_OUTPUT"
echo "busybox=${IMAGE}:${DATETIME}-${BRANCH}.busybox,${IMAGE}:${BRANCH}.busybox" >> "$GITHUB_OUTPUT"
echo "full=${IMAGE}:${DATETIME}-${BRANCH},${IMAGE}:${BRANCH}" >> "$GITHUB_OUTPUT"
fi
- name: Set up QEMU
@@ -61,7 +60,6 @@ jobs:
file: Dockerfile.minimal
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
no-cache: true
tags: ${{ steps.tags.outputs.minimal }}
- name: Build and push busybox
@@ -71,7 +69,6 @@ jobs:
file: Dockerfile.busybox
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
no-cache: true
tags: ${{ steps.tags.outputs.busybox }}
- name: Build and push full
@@ -81,7 +78,6 @@ jobs:
file: Dockerfile.full
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
no-cache: true
tags: ${{ steps.tags.outputs.full }}
- name: Delete untagged GHCR images