Fixed docker CI
All checks were successful
Publish Server Image / build-and-push-image (push) Successful in 2m12s

This commit is contained in:
Ultradesu
2026-03-17 19:03:48 +00:00
parent bfc0675f5a
commit 85b3cb6852
6 changed files with 27 additions and 16 deletions

View File

@@ -2,6 +2,8 @@ name: Publish Server Image
on:
push:
branches:
- '**'
tags:
- 'v*.*.*'
@@ -29,22 +31,29 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,format=short
- name: Determine version and tags
id: info
run: |
IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
SHORT_SHA="$(echo '${{ github.sha }}' | cut -c1-7)"
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
TAG="${{ github.ref_name }}"
VERSION="${TAG#v}"
echo "tags=${IMAGE}:${VERSION},${IMAGE}:latest" >> "$GITHUB_OUTPUT"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
else
echo "tags=${IMAGE}:trunk,${IMAGE}:${SHORT_SHA}" >> "$GITHUB_OUTPUT"
echo "version=${SHORT_SHA}" >> "$GITHUB_OUTPUT"
fi
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.info.outputs.tags }}
build-args: |
FURUMI_VERSION=${{ steps.info.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max