Skip to content

Commit e4b3e0f

Browse files
authored
Merge pull request #711 from turbo124/master
Revert and run on ubuntu 22.04
2 parents febb702 + a060c70 commit e4b3e0f

File tree

3 files changed

+32
-53
lines changed

3 files changed

+32
-53
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616

1717
jobs:
1818
docker:
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-22.04
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@v2
Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
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
73
on:
84
push:
95
tags-ignore:
106
- "invoiceninja-*"
117

128
jobs:
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 }}

alpine/5/Dockerfile

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ FROM php:${PHP_VERSION}-fpm-alpine${ALPINE_VERSION} AS phpbuild
3131

3232
LABEL maintainer="David Bomba <[email protected]>"
3333

34-
ARG php_require="bcmath gd pdo_mysql zip mbstring"
34+
ARG php_require="bcmath gd pdo_mysql zip"
3535
ARG php_suggest="exif imagick intl pcntl soap"
3636
ARG php_extra="opcache"
3737

@@ -47,28 +47,15 @@ RUN set -eux; \
4747
chromium \
4848
# font-noto-cjk-extra \
4949
# font-wqy-zenhei \
50-
freetype \
51-
libpng \
52-
libjpeg-turbo \
53-
freetype-dev \
54-
libpng-dev \
55-
libjpeg-turbo-dev \
5650
ttf-freefont \
5751
ttf-dejavu
5852

59-
COPY --from=ghcr.io/mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
60-
61-
RUN install-php-extensions \
53+
# Install PHP extensions
54+
RUN ( curl -sSLf https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - || echo 'return 1' ) | sh -s \
6255
${php_require} \
6356
${php_suggest} \
6457
${php_extra}
6558

66-
# Install PHP extensions
67-
# RUN ( curl -sSLf https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - || echo 'return 1' ) | sh -s \
68-
# ${php_require} \
69-
# ${php_suggest} \
70-
# ${php_extra}
71-
7259
# Copy files
7360
COPY rootfs /
7461

0 commit comments

Comments
 (0)