mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2025-12-31 19:47:25 +01:00
75 lines
2.3 KiB
YAML
75 lines
2.3 KiB
YAML
name: Publish Debian Container Images
|
|
|
|
on:
|
|
push:
|
|
tags-ignore:
|
|
- "invoiceninja-*"
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- image: invoiceninja/invoiceninja-octane
|
|
context: ./debian
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4 # Updated from v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Prepare
|
|
id: prep
|
|
run: |
|
|
DOCKER_IMAGE=${{ matrix.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: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3 # Updated from v1
|
|
with:
|
|
platforms: all
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v3 # Updated from v1
|
|
|
|
- name: Login to DockerHub
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v3 # Updated from v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
|
|
- name: Build and push
|
|
id: docker_build
|
|
uses: docker/build-push-action@v5 # Updated from v2
|
|
with:
|
|
context: ${{ matrix.context }}
|
|
build-args: INVOICENINJA_VERSION=${{ steps.prep.outputs.version }}
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: ${{ steps.prep.outputs.tags }}
|
|
cache-from: type=gha # Updated cache type
|
|
cache-to: type=gha,mode=max
|
|
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }} |