Skip to content

Commit dc7f5dc

Browse files
authored
Merge pull request #27 from 10up/feature/ubuntu2404
Feature/ubuntu2404
2 parents 9b406e3 + 8a3f246 commit dc7f5dc

File tree

3 files changed

+95
-54
lines changed

3 files changed

+95
-54
lines changed

.github/workflows/build.yaml

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,69 @@ jobs:
1212
strategy:
1313
matrix:
1414
version: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
15+
ubuntu-release-name: ['jammy', 'noble']
1516
environment:
1617
name: Build
1718
runs-on: ubuntu-latest
1819
steps:
1920
- name: Checkout
20-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2122
with:
2223
ref: ${{ github.ref }}
2324

2425
- name: Set up QEMU
25-
uses: docker/setup-qemu-action@v2
26+
uses: docker/setup-qemu-action@v3
2627

2728
- name: Set up Docker Buildx
28-
uses: docker/setup-buildx-action@v2
29+
uses: docker/setup-buildx-action@v3
2930

30-
- name: Login to DockerHub
31-
uses: docker/login-action@v2
31+
- name: Extract metadata (tags, labels) for Docker (Jammy)
32+
if: matrix.ubuntu-release-name == 'jammy'
33+
id: meta-jammy
34+
uses: docker/metadata-action@v5
3235
with:
33-
username: ${{ secrets.DOCKERHUB_USERNAME }}
34-
password: ${{ secrets.DOCKERHUB_TOKEN }}
35-
36-
- name: Login to Github Packages
37-
uses: docker/login-action@v2
38-
with:
39-
registry: ghcr.io
40-
username: ${{ github.actor }}
41-
password: ${{ secrets.GITHUB_TOKEN }}
36+
tags: |
37+
type=raw,pattern={{version}},value=${{ matrix.version }}-${{ matrix.ubuntu-release-name }}
38+
type=raw,pattern={{version}},value=${{ matrix.version }}-ubuntu
39+
images: |
40+
${{ secrets.IMAGE_NAME }}
41+
ghcr.io/${{ github.repository }}
4242
43-
- name: Extract metadata (tags, labels) for Docker
44-
id: meta
45-
uses: docker/metadata-action@v4
43+
- name: Extract metadata (tags, labels) for Docker (Others)
44+
if: matrix.ubuntu-release-name != 'jammy'
45+
id: meta-others
46+
uses: docker/metadata-action@v5
4647
with:
4748
tags: |
48-
type=raw,pattern={{version}},value=${{ matrix.version }}-ubuntu
49+
type=raw,pattern={{version}},value=${{ matrix.version }}-${{ matrix.ubuntu-release-name }}
4950
images: |
5051
${{ secrets.IMAGE_NAME }}
5152
ghcr.io/${{ github.repository }}
5253
53-
- name: Build and push Docker images
54-
uses: docker/build-push-action@v4
54+
- name: Build and push Docker images (Jammy)
55+
if: matrix.ubuntu-release-name == 'jammy'
56+
uses: docker/build-push-action@v6
5557
with:
5658
push: true
5759
platforms: linux/amd64,linux/arm64
58-
build-args: PHP_VERSION=${{ matrix.version }}
59-
tags: ${{ steps.meta.outputs.tags }}
60-
labels: ${{ steps.meta.outputs.labels }}
60+
build-args: |
61+
PHP_VERSION=${{ matrix.version }}
62+
UBUNTU_RELEASE_NAME=${{ matrix.ubuntu-release-name }}
63+
tags: ${{ steps.meta-jammy.outputs.tags }}
64+
labels: ${{ steps.meta-jammy.outputs.labels }}
65+
66+
- name: Build and push Docker images (Others)
67+
if: matrix.ubuntu-release-name != 'jammy'
68+
uses: docker/build-push-action@v6
69+
with:
70+
push: true
71+
platforms: linux/amd64,linux/arm64
72+
build-args: |
73+
PHP_VERSION=${{ matrix.version }}
74+
UBUNTU_RELEASE_NAME=${{ matrix.ubuntu-release-name }}
75+
tags: ${{ steps.meta-others.outputs.tags }}
76+
labels: ${{ steps.meta-others.outputs.labels }}
77+
6178

6279
Build_PHP_CentOS8:
6380
strategy:
@@ -68,24 +85,18 @@ jobs:
6885
runs-on: ubuntu-latest
6986
steps:
7087
- name: Checkout
71-
uses: actions/checkout@v3
88+
uses: actions/checkout@v4
7289
with:
7390
ref: ${{ github.ref }}
7491

7592
- name: Set up QEMU
76-
uses: docker/setup-qemu-action@v2
93+
uses: docker/setup-qemu-action@v3
7794

7895
- name: Set up Docker Buildx
79-
uses: docker/setup-buildx-action@v2
80-
81-
- name: Login to DockerHub
82-
uses: docker/login-action@v2
83-
with:
84-
username: ${{ secrets.DOCKERHUB_USERNAME }}
85-
password: ${{ secrets.DOCKERHUB_TOKEN }}
96+
uses: docker/setup-buildx-action@v3
8697

8798
- name: Build and push CentOS based Docker images
88-
uses: docker/build-push-action@v3
99+
uses: docker/build-push-action@v6
89100
with:
90101
push: true
91102
context: centos8

.github/workflows/test-build.yaml

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Images
1+
name: Build Images (Testing)
22

33
on:
44
push:
@@ -10,39 +10,68 @@ jobs:
1010
strategy:
1111
matrix:
1212
version: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
13+
ubuntu-release-name: ['jammy', 'noble']
1314
environment:
1415
name: Build
1516
runs-on: ubuntu-latest
1617
steps:
1718
- name: Checkout
18-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
1920
with:
2021
ref: ${{ github.ref }}
2122

2223
- name: Set up QEMU
23-
uses: docker/setup-qemu-action@v2
24+
uses: docker/setup-qemu-action@v3
2425

2526
- name: Set up Docker Buildx
26-
uses: docker/setup-buildx-action@v2
27+
uses: docker/setup-buildx-action@v3
2728

28-
- name: Extract metadata (tags, labels) for Docker
29-
id: meta
30-
uses: docker/metadata-action@v4
29+
- name: Extract metadata (tags, labels) for Docker (Jammy)
30+
if: matrix.ubuntu-release-name == 'jammy'
31+
id: meta-jammy
32+
uses: docker/metadata-action@v5
3133
with:
3234
tags: |
33-
type=raw,pattern={{version}},value=${{ matrix.version }}-ubuntu
35+
type=raw,pattern={{version}},value=${{ matrix.version }}-${{ matrix.ubuntu-release-name }}
36+
type=raw,pattern={{version}},value=${{ matrix.version }}-ubuntu
3437
images: |
3538
${{ secrets.IMAGE_NAME }}
3639
ghcr.io/${{ github.repository }}
3740
38-
- name: Build and push Docker images
39-
uses: docker/build-push-action@v4
41+
- name: Extract metadata (tags, labels) for Docker (Others)
42+
if: matrix.ubuntu-release-name != 'jammy'
43+
id: meta-others
44+
uses: docker/metadata-action@v5
45+
with:
46+
tags: |
47+
type=raw,pattern={{version}},value=${{ matrix.version }}-${{ matrix.ubuntu-release-name }}
48+
images: |
49+
${{ secrets.IMAGE_NAME }}
50+
ghcr.io/${{ github.repository }}
51+
52+
- name: Build and push Docker images (Jammy)
53+
if: matrix.ubuntu-release-name == 'jammy'
54+
uses: docker/build-push-action@v6
4055
with:
4156
push: false
4257
platforms: linux/amd64,linux/arm64
43-
build-args: PHP_VERSION=${{ matrix.version }}
44-
tags: ${{ steps.meta.outputs.tags }}
45-
labels: ${{ steps.meta.outputs.labels }}
58+
build-args: |
59+
PHP_VERSION=${{ matrix.version }}
60+
UBUNTU_RELEASE_NAME=${{ matrix.ubuntu-release-name }}
61+
tags: ${{ steps.meta-jammy.outputs.tags }}
62+
labels: ${{ steps.meta-jammy.outputs.labels }}
63+
64+
- name: Build and push Docker images (Others)
65+
if: matrix.ubuntu-release-name != 'jammy'
66+
uses: docker/build-push-action@v6
67+
with:
68+
push: false
69+
platforms: linux/amd64,linux/arm64
70+
build-args: |
71+
PHP_VERSION=${{ matrix.version }}
72+
UBUNTU_RELEASE_NAME=${{ matrix.ubuntu-release-name }}
73+
tags: ${{ steps.meta-others.outputs.tags }}
74+
labels: ${{ steps.meta-others.outputs.labels }}
4675

4776

4877
Build_PHP_CentOS8_Test:
@@ -54,18 +83,18 @@ jobs:
5483
runs-on: ubuntu-latest
5584
steps:
5685
- name: Checkout
57-
uses: actions/checkout@v3
86+
uses: actions/checkout@v4
5887
with:
5988
ref: ${{ github.ref }}
6089

6190
- name: Set up QEMU
62-
uses: docker/setup-qemu-action@v2
91+
uses: docker/setup-qemu-action@v3
6392

6493
- name: Set up Docker Buildx
65-
uses: docker/setup-buildx-action@v2
94+
uses: docker/setup-buildx-action@v3
6695

6796
- name: Build and push CentOS based Docker images
68-
uses: docker/build-push-action@v4
97+
uses: docker/build-push-action@v6
6998
with:
7099
push: false
71100
context: centos8

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ ARG PHP_VERSION=8.2
22

33
# Set a BASE_IMAGE CI var to specify a different base image without a tag
44
ARG BASE_IMAGE=ghcr.io/10up/base-php
5-
FROM ${BASE_IMAGE}:${PHP_VERSION}-ubuntu
5+
ARG UBUNTU_RELEASE_NAME=jammy
6+
FROM ${BASE_IMAGE}:${PHP_VERSION}-${UBUNTU_RELEASE_NAME}
67

78
ARG PHP_VERSION=8.2
89
ARG TARGETPLATFORM
@@ -15,7 +16,7 @@ RUN apt-get update; apt install php${PHP_VERSION}-fpm msmtp curl -y && apt clean
1516

1617
# Routine to install newrelic agent
1718
RUN \
18-
if [[ "${TARGETPLATFORM}" = "linux/arm64" ]] || [[ "$(uname -m)" = "aarch64" ]]; then exit 0; fi ; export NR_AGENT_VERSION="newrelic-php5-9.20.0.310-linux.tar.gz"; curl -so - https://download.newrelic.com/php_agent/archive/9.20.0.310/${NR_AGENT_VERSION} | tar zxf - && \
19+
if [[ "${TARGETPLATFORM}" = "linux/arm64" ]] || [[ "$(uname -m)" = "aarch64" ]]; then exit 0; fi ; export NR_AGENT_VERSION="newrelic-php5-11.0.0.13-linux.tar.gz"; curl -so - https://download.newrelic.com/php_agent/archive/11.0.0.13/${NR_AGENT_VERSION} | tar zxf - && \
1920
cd newrelic-php* && NR_INSTALL_SILENT=1 NR_INSTALL_USE_CP_NOT_LN=1 ./newrelic-install install && \
2021
rm -rf /tmp/nrinstall* && \
2122
echo 'newrelic.daemon.start_timeout = "5s"' >> /etc/php/${PHP_VERSION}/mods-available/newrelic.ini && \
@@ -34,8 +35,8 @@ RUN \
3435
# You must set DD_AGENT_HOST and DD_TRACE_AGENT_PORT to point at your DD Agent
3536
# We also clean up whatever this config file layout is
3637
RUN \
37-
curl -LO https://github.com/DataDog/dd-trace-php/releases/download/0.94.0/datadog-setup.php -o /tmp/datadog-setup.php && \
38-
if [[ ${PHP_VERSION} = "5.6" ]] || [[ ${PHP_VERSION} = "7.0" ]]; then php datadog-setup.php --php-bin=all; else php datadog-setup.php --enable-profiling --php-bin=all; fi && \
38+
curl -LO https://github.com/DataDog/dd-trace-php/releases/download/1.2.0/datadog-setup.php -o /tmp/datadog-setup.php && \
39+
if [[ ${PHP_VERSION} = "5.6" ]] || [[ ${PHP_VERSION} = "7.0" ]]; then php datadog-setup.php --php-bin=all; else php datadog-setup.php --php-bin=all; fi && \
3940
rm -f /tmp/datadog-setup.php && \
4041
mv /etc/php/${PHP_VERSION}/cli/conf.d/98-ddtrace.ini /etc/php/${PHP_VERSION}/mods-available/ddtrace.ini && \
4142
rm -f /etc/php/${PHP_VERSION}/fpm/conf.d/98-ddtrace.ini

0 commit comments

Comments
 (0)