1- name : Publish Container Image
1+ name : Publish Debian Container Images
22
3- # When its time to do a release do a full cross platform build for all supported
4- # architectures and push all of them to Docker Hub.
5- # Only trigger on semver shaped tags.
6- # Ref: https://github.com/metcalfc/docker-action-examples/blob/main/.github/workflows/release.yml
73on :
84 push :
95 tags-ignore :
106 - " invoiceninja-*"
117
128jobs :
139 docker :
14- runs-on : ubuntu-latest
10+ runs-on : ubuntu-22.04
11+ strategy :
12+ matrix :
13+ include :
14+ - image : invoiceninja/invoiceninja-octane
15+ context : ./debian
16+
1517 steps :
1618 - name : Checkout
17- uses : actions/checkout@v2
19+ uses : actions/checkout@v4 # Updated from v2
20+ with :
21+ fetch-depth : 0
1822
1923 - name : Prepare
2024 id : prep
2125 run : |
22- DOCKER_IMAGE=invoiceninja/invoiceninja
26+ DOCKER_IMAGE=${{ matrix.image }}
2327 VERSION=edge
2428 if [[ $GITHUB_REF == refs/tags/* ]]; then
2529 VERSION=${GITHUB_REF#refs/tags/}
@@ -28,56 +32,44 @@ jobs:
2832 MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
2933 MINOR="$(echo "${VERSION}" | cut -d. -f2)"
3034 TAGS="$TAGS,${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:${MAJOR}.${MINOR}"
31- if [[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
32- TAGS="$TAGS,${DOCKER_IMAGE}:latest"
33- fi
34- echo "tags=${TAGS}" >> $GITHUB_OUTPUT
35+
36+ # Debug output
37+ echo "Current version: ${VERSION}"
38+ echo "Version pattern check: $([[ $VERSION =~ ^5\.[0-9]{1,3}\.[0-9]{1,3}$ ]] && echo "matches" || echo "doesn't match")"
39+
40+ TAGS="$TAGS,${DOCKER_IMAGE}:latest"
41+
42+ echo "tags=${TAGS}" >> $GITHUB_OUTPUT # Updated output syntax
3543 echo "version=${VERSION}" >> $GITHUB_OUTPUT
3644 echo "major=${MAJOR}" >> $GITHUB_OUTPUT
3745
3846 - name : Set up QEMU
39- uses : docker/setup-qemu-action@v1
47+ uses : docker/setup-qemu-action@v3 # Updated from v1
4048 with :
4149 platforms : all
4250
4351 - name : Set up Docker Buildx
4452 id : buildx
45- uses : docker/setup-buildx-action@v1
46-
47- - name : Cache Docker layers
48- uses : actions/cache@v4
49- with :
50- path : /tmp/.buildx-cache
51- key : ${{ runner.os }}-buildx-5-${{ hashFiles('alpine/5/cache_buster') }}-${{ github.sha }}
52- restore-keys : |
53- ${{ runner.os }}-buildx-5-${{ hashFiles('alpine/5/cache_buster') }}-
53+ uses : docker/setup-buildx-action@v3 # Updated from v1
5454
5555 - name : Login to DockerHub
5656 if : github.event_name != 'pull_request'
57- uses : docker/login-action@v1
57+ uses : docker/login-action@v3 # Updated from v1
5858 with :
5959 username : ${{ secrets.DOCKERHUB_USERNAME }}
6060 password : ${{ secrets.DOCKERHUB_PASSWORD }}
6161
6262 - name : Build and push
6363 id : docker_build
64- uses : docker/build-push-action@v2
64+ uses : docker/build-push-action@v5 # Updated from v2
6565 with :
66- builder : ${{ steps.buildx.outputs.name }}
67- context : ./alpine/${{ steps.prep.outputs.major }}/
66+ context : ${{ matrix.context }}
6867 build-args : INVOICENINJA_VERSION=${{ steps.prep.outputs.version }}
69- target : prod
7068 platforms : linux/amd64,linux/arm64
7169 push : ${{ github.event_name != 'pull_request' }}
7270 tags : ${{ steps.prep.outputs.tags }}
73- cache-from : type=local,src=/tmp/.buildx-cache
74- cache-to : type=local,dest=/tmp/.buildx-cache-new
75-
76- - name : Move cache
77- run : |
78- mkdir -p /tmp/.buildx-cache
79- rm -rf /tmp/.buildx-cache
80- mv /tmp/.buildx-cache-new /tmp/.buildx-cache
71+ cache-from : type=gha # Updated cache type
72+ cache-to : type=gha,mode=max
8173
8274 - name : Image digest
83- run : echo ${{ steps.docker_build.outputs.digest }}
75+ run : echo ${{ steps.docker_build.outputs.digest }}
0 commit comments