Skip to content

Commit 3bf4174

Browse files
authored
Merge pull request #712 from turbo124/master
Fixes for publish-image regression
2 parents e4b3e0f + 18550bc commit 3bf4174

File tree

2 files changed

+33
-27
lines changed

2 files changed

+33
-27
lines changed

.github/workflows/build-image-v5.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,5 @@ jobs:
5353

5454
- name: Move cache
5555
run: |
56-
mkdir -p /tmp/.buildx-cache
5756
rm -rf /tmp/.buildx-cache
5857
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
name: Publish Debian Container Images
1+
name: Publish Container Image
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
37
on:
48
push:
59
tags-ignore:
@@ -8,22 +12,14 @@ on:
812
jobs:
913
docker:
1014
runs-on: ubuntu-22.04
11-
strategy:
12-
matrix:
13-
include:
14-
- image: invoiceninja/invoiceninja-octane
15-
context: ./debian
16-
1715
steps:
1816
- name: Checkout
19-
uses: actions/checkout@v4 # Updated from v2
20-
with:
21-
fetch-depth: 0
17+
uses: actions/checkout@v2
2218

2319
- name: Prepare
2420
id: prep
2521
run: |
26-
DOCKER_IMAGE=${{ matrix.image }}
22+
DOCKER_IMAGE=invoiceninja/invoiceninja
2723
VERSION=edge
2824
if [[ $GITHUB_REF == refs/tags/* ]]; then
2925
VERSION=${GITHUB_REF#refs/tags/}
@@ -32,44 +28,55 @@ jobs:
3228
MAJOR="$(echo "${VERSION}" | cut -d. -f1)"
3329
MINOR="$(echo "${VERSION}" | cut -d. -f2)"
3430
TAGS="$TAGS,${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:${MAJOR}.${MINOR}"
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
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
4335
echo "version=${VERSION}" >> $GITHUB_OUTPUT
4436
echo "major=${MAJOR}" >> $GITHUB_OUTPUT
4537
4638
- name: Set up QEMU
47-
uses: docker/setup-qemu-action@v3 # Updated from v1
39+
uses: docker/setup-qemu-action@v1
4840
with:
4941
platforms: all
5042

5143
- name: Set up Docker Buildx
5244
id: buildx
53-
uses: docker/setup-buildx-action@v3 # Updated from v1
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') }}-
5454
5555
- name: Login to DockerHub
5656
if: github.event_name != 'pull_request'
57-
uses: docker/login-action@v3 # Updated from v1
57+
uses: docker/login-action@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@v5 # Updated from v2
64+
uses: docker/build-push-action@v2
6565
with:
66-
context: ${{ matrix.context }}
66+
builder: ${{ steps.buildx.outputs.name }}
67+
context: ./alpine/${{ steps.prep.outputs.major }}/
6768
build-args: INVOICENINJA_VERSION=${{ steps.prep.outputs.version }}
69+
target: prod
6870
platforms: linux/amd64,linux/arm64
6971
push: ${{ github.event_name != 'pull_request' }}
7072
tags: ${{ steps.prep.outputs.tags }}
71-
cache-from: type=gha # Updated cache type
72-
cache-to: type=gha,mode=max
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+
rm -rf /tmp/.buildx-cache
79+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
7380
7481
- name: Image digest
7582
run: echo ${{ steps.docker_build.outputs.digest }}

0 commit comments

Comments
 (0)