Skip to content

Commit c643f6e

Browse files
committed
Build linux/arm64 images on arm runner
1 parent 38a8167 commit c643f6e

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

.github/workflows/push.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@ jobs:
1717
run: echo "php_versions=$(make _versions)" >> "$GITHUB_ENV"
1818
build:
1919
name: PHP
20-
runs-on: ubuntu-24.04
2120
needs: php-versions
2221
strategy:
2322
fail-fast: false
2423
matrix:
2524
php: ${{ fromJSON(needs.php-versions.outputs.matrix) }}
2625
platform: [linux/arm64, linux/amd64]
26+
include:
27+
- platform: linux/arm64
28+
runner: ubuntu-24.04-arm
29+
- platform: linux/amd64
30+
runner: ubuntu-24.04
31+
runs-on: ${{ matrix.runner }}
2732
steps:
2833
- uses: actions/checkout@v6
2934
- name: Set up QEMU
@@ -49,11 +54,9 @@ jobs:
4954
org.opencontainers.image.revision=${{ github.sha }}
5055
tags: |
5156
ghcr.io/${{ github.repository }}:${{ matrix.php }}
52-
load: ${{ (matrix.platform == 'linux/amd64') }}
57+
load: true
5358
- uses: e1himself/[email protected]
54-
if: ${{ (matrix.platform == 'linux/amd64') }}
5559
- name: Test PHP ${{ matrix.php }}
56-
if: ${{ (matrix.platform == 'linux/amd64') }}
5760
run: |
5861
# Sleep a bit to ensure that PHP-FPM has time to start up.
59-
GOSS_SLEEP=15 dgoss run -e GOSS_VARS_INLINE='php_version: "${{ matrix.php }}"' ghcr.io/${{ github.repository }}:${{ matrix.php }}
62+
GOSS_SLEEP=15 dgoss run --pull=never -e GOSS_VARS_INLINE='php_version: "${{ matrix.php }}"' ghcr.io/${{ github.repository }}:${{ matrix.php }}

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,20 @@ jobs:
2323
run: echo "php_versions=$(make _versions)" >> "$GITHUB_ENV"
2424
build:
2525
name: PHP
26-
runs-on: ubuntu-24.04
2726
needs: php-versions
2827
if: >-
2928
${{ github.event.workflow_run.conclusion == 'success' }}
3029
strategy:
3130
fail-fast: false
3231
matrix:
3332
php: ${{ fromJSON(needs.php-versions.outputs.matrix) }}
33+
platform: [linux/arm64, linux/amd64]
34+
include:
35+
- platform: linux/arm64
36+
runner: ubuntu-24.04-arm
37+
- platform: linux/amd64
38+
runner: ubuntu-24.04
39+
runs-on: ${{ matrix.runner }}
3440
steps:
3541
- uses: actions/checkout@v6
3642
- name: Set up QEMU
@@ -49,12 +55,12 @@ jobs:
4955
with:
5056
file: "Dockerfile"
5157
builder: ${{ steps.buildx.outputs.name }}
52-
push: true
5358
context: .
54-
platforms: linux/amd64,linux/arm64
59+
platforms: ${{ matrix.platform }}
5560
build-args: "php=${{ matrix.php }}"
5661
cache-from: type=gha
5762
cache-to: type=gha,mode=max
63+
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
5864
labels: |
5965
org.opencontainers.image.title=PHP ${{ matrix.php }}
6066
org.opencontainers.image.description=Docker image for PHP ${{ matrix.php }} FPM

0 commit comments

Comments
 (0)