diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml index ec24be5..0195c63 100644 --- a/.github/workflows/test-build.yaml +++ b/.github/workflows/test-build.yaml @@ -1,4 +1,4 @@ -name: Build Images +name: Build Images (Testing) on: push: @@ -10,39 +10,68 @@ jobs: strategy: matrix: version: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + ubuntu-release-name: ['jammy', 'noble'] environment: name: Build runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.ref }} - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 + - name: Extract metadata (tags, labels) for Docker (Jammy) + if: matrix.ubuntu-release-name == 'jammy' + id: meta-jammy + uses: docker/metadata-action@v5 with: tags: | - type=raw,pattern={{version}},value=${{ matrix.version }}-ubuntu + type=raw,pattern={{version}},value=${{ matrix.version }}-${{ matrix.ubuntu-release-name }} + type=raw,pattern={{version}},value=${{ matrix.version }}-ubuntu images: | ${{ secrets.IMAGE_NAME }} ghcr.io/${{ github.repository }} - - name: Build and push Docker images - uses: docker/build-push-action@v4 + - name: Extract metadata (tags, labels) for Docker (Others) + if: matrix.ubuntu-release-name != 'jammy' + id: meta-others + uses: docker/metadata-action@v5 + with: + tags: | + type=raw,pattern={{version}},value=${{ matrix.version }}-${{ matrix.ubuntu-release-name }} + images: | + ${{ secrets.IMAGE_NAME }} + ghcr.io/${{ github.repository }} + + - name: Build and push Docker images (Jammy) + if: matrix.ubuntu-release-name == 'jammy' + uses: docker/build-push-action@v6 with: push: false platforms: linux/amd64,linux/arm64 - build-args: PHP_VERSION=${{ matrix.version }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + build-args: | + PHP_VERSION=${{ matrix.version }} + UBUNTU_RELEASE_NAME=${{ matrix.ubuntu-release-name }} + tags: ${{ steps.meta-jammy.outputs.tags }} + labels: ${{ steps.meta-jammy.outputs.labels }} + + - name: Build and push Docker images (Others) + if: matrix.ubuntu-release-name != 'jammy' + uses: docker/build-push-action@v6 + with: + push: false + platforms: linux/amd64,linux/arm64 + build-args: | + PHP_VERSION=${{ matrix.version }} + UBUNTU_RELEASE_NAME=${{ matrix.ubuntu-release-name }} + tags: ${{ steps.meta-others.outputs.tags }} + labels: ${{ steps.meta-others.outputs.labels }} Build_PHP_CentOS8_Test: @@ -54,18 +83,18 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.ref }} - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build and push CentOS based Docker images - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: push: false context: centos8 diff --git a/Dockerfile b/Dockerfile index 1f0155e..8bc4415 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,8 @@ ARG PHP_VERSION=8.2 # Set a BASE_IMAGE CI var to specify a different base image without a tag ARG BASE_IMAGE=ghcr.io/10up/base-php -FROM ${BASE_IMAGE}:${PHP_VERSION}-ubuntu +ARG UBUNTU_RELEASE_NAME=jammy +FROM ${BASE_IMAGE}:${PHP_VERSION}-${UBUNTU_RELEASE_NAME} ARG PHP_VERSION=8.2 ARG TARGETPLATFORM @@ -34,7 +35,7 @@ RUN \ # You must set DD_AGENT_HOST and DD_TRACE_AGENT_PORT to point at your DD Agent # We also clean up whatever this config file layout is RUN \ - curl -LO https://github.com/DataDog/dd-trace-php/releases/download/0.94.0/datadog-setup.php -o /tmp/datadog-setup.php && \ + curl -LO https://github.com/DataDog/dd-trace-php/releases/download/1.2.0/datadog-setup.php -o /tmp/datadog-setup.php && \ 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 && \ rm -f /tmp/datadog-setup.php && \ mv /etc/php/${PHP_VERSION}/cli/conf.d/98-ddtrace.ini /etc/php/${PHP_VERSION}/mods-available/ddtrace.ini && \