Skip to content

Commit

Permalink
Run ARM build on ARM machines
Browse files Browse the repository at this point in the history
  • Loading branch information
andyundso committed Jan 28, 2025
1 parent 82fa7ad commit fe7cbb4
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ jobs:
base-images:
# for security reason, we only build these images in our repository and on the main branch
if: github.repository == 'pgautoupgrade/docker-pgautoupgrade' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
strategy:
matrix:
runner_image:
- "ubuntu-24.04"
- "ubuntu-24.04-arm"
flavor:
- alpine
- bookworm
Expand All @@ -29,11 +31,9 @@ jobs:
- "14"
- "15"
- "16"
runs-on: "${{ matrix.runner_image }}"

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -48,7 +48,6 @@ jobs:
with:
file: "Dockerfile.${{ matrix.flavor }}"
push: true
platforms: linux/amd64,linux/arm64
build-args: |
"PGTARGET=16"
target: "build-${{ matrix.pg_version }}"
Expand All @@ -57,7 +56,6 @@ jobs:
cache-from: type=registry,ref=pgautoupgrade/pgautoupgrade:build-${{ matrix.pg_version }}-${{ matrix.flavor }}

target-images:
runs-on: ubuntu-latest
needs: base-images
# otherwise, it would skip the build entirely (because the base step does not run)
if: always()
Expand All @@ -80,6 +78,9 @@ jobs:
strategy:
matrix:
runner_image:
- "ubuntu-24.04"
- "ubuntu-24.04-arm"
operating_system:
- flavor: "alpine"
# renovate: datasource=docker depName=alpine versioning=docker
Expand All @@ -94,11 +95,9 @@ jobs:
- "15"
- "16"
- "17"
runs-on: "${{ matrix.runner_image }}"

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down Expand Up @@ -147,7 +146,6 @@ jobs:
uses: docker/build-push-action@v6
with:
file: "Dockerfile.${{ matrix.operating_system.flavor }}"
platforms: linux/amd64,linux/arm64
tags: |
"pgautoupgrade/pgautoupgrade:${{ matrix.pg_target }}-${{ matrix.operating_system.flavor }}"
"pgautoupgrade/pgautoupgrade:${{ matrix.pg_target }}-${{ matrix.operating_system.flavor }}${{ matrix.operating_system.OS_VERSION }}"
Expand All @@ -163,7 +161,6 @@ jobs:
uses: docker/build-push-action@v6
with:
file: "Dockerfile.${{ matrix.operating_system.flavor }}"
platforms: linux/amd64,linux/arm64
tags: |
"pgautoupgrade/pgautoupgrade:${{ matrix.operating_system.flavor }}"
"pgautoupgrade/pgautoupgrade:${{ matrix.operating_system.alias }}"
Expand All @@ -178,7 +175,6 @@ jobs:
uses: docker/build-push-action@v6
with:
file: "Dockerfile.${{ matrix.operating_system.flavor }}"
platforms: linux/amd64,linux/arm64
tags: |
"pgautoupgrade/pgautoupgrade:latest"
build-args: |
Expand Down

0 comments on commit fe7cbb4

Please sign in to comment.