Skip to content

Commit

Permalink
introduce a ubuntu 24.04 (noble) version
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinrue committed Aug 12, 2024
1 parent dc5f445 commit 5009c2c
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 32 deletions.
58 changes: 43 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,81 @@ 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
if: ${{ github.ref == 'refs/heads/trunk' }}
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: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to Github Packages
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- 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: true
platforms: linux/amd64,linux/arm64
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: true
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-others.outputs.tags }}
labels: ${{ steps.meta-others.outputs.labels }}



52 changes: 40 additions & 12 deletions .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,65 @@ 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 }}
20 changes: 15 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
ARG PHP_VERSION=8.2

# Set a BASE_IMAGE CI var to specify a different base image
ARG BASE_IMAGE=ghcr.io/10up/wp-php-fpm-dev
FROM ${BASE_IMAGE}:${PHP_VERSION}-ubuntu
ARG UBUNTU_RELEASE_NAME=jammy
FROM ${BASE_IMAGE}:${PHP_VERSION}-${UBUNTU_RELEASE_NAME}

ARG PHP_VERSION=8.2

Expand All @@ -22,10 +24,18 @@ RUN apt-get update && \


RUN \
pip3 --no-cache-dir install \
python-gitlab \
mitzasql \
ranger-fm
if [ $(grep VERSION_CODENAME /etc/os-release | cut -d '=' -f 2) = 'jammy' ]; then \
pip3 --no-cache-dir install \
python-gitlab \
mitzasql \
ranger-fm; \
else \
pip3 --no-cache-dir install --break-system-packages \
python-gitlab \
mitzasql \
ranger-fm; \
fi


RUN \
curl -fsSL https://code-server.dev/install.sh | sh; \
Expand Down

0 comments on commit 5009c2c

Please sign in to comment.