mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2025-12-31 19:47:25 +01:00
Merge pull request #820 from benbrummer/debian
TAGS without REGISTRY_IMAGE
This commit is contained in:
57
.github/workflows/publish-image.yaml
vendored
57
.github/workflows/publish-image.yaml
vendored
@@ -9,10 +9,35 @@ env:
|
|||||||
REGISTRY_IMAGE: invoiceninja/invoiceninja-debian
|
REGISTRY_IMAGE: invoiceninja/invoiceninja-debian
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
version:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.version.outputs.version }}
|
||||||
|
major: ${{ steps.version.outputs.major }}
|
||||||
|
minor: ${{ steps.version.outputs.minor }}
|
||||||
|
steps:
|
||||||
|
- id: version
|
||||||
|
run: |
|
||||||
|
|
||||||
|
VERSION=edge
|
||||||
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
|
VERSION=${GITHUB_REF#refs/tags/}
|
||||||
|
fi
|
||||||
|
MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
|
||||||
|
MINOR="$(echo "${VERSION}" | cut -d. -f2)"
|
||||||
|
|
||||||
|
# Debug output
|
||||||
|
echo "Current version: ${VERSION}"
|
||||||
|
echo "Version pattern check: $([[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]] && echo "matches" || echo "doesn't match")"
|
||||||
|
|
||||||
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
echo "major=${MAJOR}" >> $GITHUB_OUTPUT
|
||||||
|
echo "minor=${MINOR}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
|
runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
|
||||||
outputs:
|
needs:
|
||||||
tags: ${{ steps.prep.outputs.tags }}
|
- version
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -29,26 +54,6 @@ jobs:
|
|||||||
platform=${{ matrix.platform }}
|
platform=${{ matrix.platform }}
|
||||||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
||||||
|
|
||||||
DOCKER_IMAGE=${{ env.REGISTRY_IMAGE }}
|
|
||||||
VERSION=edge
|
|
||||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
|
||||||
VERSION=${GITHUB_REF#refs/tags/}
|
|
||||||
fi
|
|
||||||
TAGS="${DOCKER_IMAGE}:${VERSION}"
|
|
||||||
MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
|
|
||||||
MINOR="$(echo "${VERSION}" | cut -d. -f2)"
|
|
||||||
TAGS="$TAGS,${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:${MAJOR}.${MINOR}"
|
|
||||||
|
|
||||||
# Debug output
|
|
||||||
echo "Current version: ${VERSION}"
|
|
||||||
echo "Version pattern check: $([[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]] && echo "matches" || echo "doesn't match")"
|
|
||||||
|
|
||||||
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
|
|
||||||
|
|
||||||
echo "tags=${TAGS}" >> $GITHUB_OUTPUT # Updated output syntax
|
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
echo "major=${MAJOR}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
@@ -70,7 +75,7 @@ jobs:
|
|||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: debian
|
context: debian
|
||||||
build-args: INVOICENINJA_VERSION=${{ steps.prep.outputs.version }}
|
build-args: INVOICENINJA_VERSION=${{ needs.version.outputs.version }}
|
||||||
platforms: ${{ matrix.platform }}
|
platforms: ${{ matrix.platform }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
tags: ${{ env.REGISTRY_IMAGE }}
|
tags: ${{ env.REGISTRY_IMAGE }}
|
||||||
@@ -95,6 +100,7 @@ jobs:
|
|||||||
merge:
|
merge:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
|
- version
|
||||||
- build
|
- build
|
||||||
steps:
|
steps:
|
||||||
- name: Download digests
|
- name: Download digests
|
||||||
@@ -119,7 +125,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY_IMAGE }}
|
images: ${{ env.REGISTRY_IMAGE }}
|
||||||
tags: |
|
tags: |
|
||||||
${{ needs.build.outputs.tags }}
|
${{ needs.version.outputs.version }}
|
||||||
|
${{ needs.version.outputs.major }}
|
||||||
|
${{ needs.version.outputs.major }}${{ needs.version.outputs.minor }}
|
||||||
|
latest
|
||||||
|
|
||||||
- name: Create manifest list and push
|
- name: Create manifest list and push
|
||||||
working-directory: ${{ runner.temp }}/digests
|
working-directory: ${{ runner.temp }}/digests
|
||||||
|
|||||||
Reference in New Issue
Block a user