Merge pull request #663 from turbo124/debian #460
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Debian Container Images | |
on: | |
push: | |
tags-ignore: | |
- "invoiceninja-*" | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- image: invoiceninja/invoiceninja-debian | |
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 }} |