Skip to content

Commit 082bb8c

Browse files
authored
Merge pull request #2021 from crazy-max/publish-on-pr
ci: run build job on pull request event
2 parents 8935ed3 + 57bafd6 commit 082bb8c

1 file changed

Lines changed: 10 additions & 18 deletions

File tree

.github/workflows/build-and-publish.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,17 @@ env:
1818
jobs:
1919
test:
2020
if: github.event_name == 'pull_request'
21-
runs-on: ${{ matrix.runner }}
21+
runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
2222
strategy:
2323
fail-fast: false
2424
matrix:
25-
include:
26-
- platform: linux/amd64
27-
runner: ubuntu-latest
28-
- platform: linux/386
29-
runner: ubuntu-latest
30-
- platform: linux/arm/v6
31-
runner: ubuntu-24.04-arm
32-
- platform: linux/arm/v7
33-
runner: ubuntu-24.04-arm
34-
- platform: linux/arm64
35-
runner: ubuntu-24.04-arm
36-
- platform: linux/riscv64
37-
runner: ubuntu-24.04-arm
25+
platform:
26+
- linux/amd64
27+
- linux/386
28+
- linux/arm/v6
29+
- linux/arm/v7
30+
- linux/arm64
31+
- linux/riscv64
3832
env:
3933
CI_ARCH: ${{ matrix.platform }}
4034
steps:
@@ -48,7 +42,6 @@ jobs:
4842
run: CIPLATFORM=${{ env.CI_ARCH }} bash test/run.sh
4943

5044
build-prepare:
51-
if: github.event_name != 'pull_request'
5245
runs-on: ubuntu-24.04
5346
outputs:
5447
components_branch: ${{ env.components_branch }}
@@ -57,8 +50,7 @@ jobs:
5750
- run: echo "Exposing env vars for reusable workflow"
5851

5952
build:
60-
if: github.event_name != 'pull_request'
61-
uses: docker/github-builder/.github/workflows/build.yml@v1
53+
uses: docker/github-builder/.github/workflows/build.yml@70313223e2665c3211b454b3fea6534624e78d64 # v1.4.0
6254
needs:
6355
- build-prepare
6456
permissions:
@@ -78,7 +70,7 @@ jobs:
7870
WEB_BRANCH=${{ needs.build-prepare.outputs.components_branch }}
7971
PADD_BRANCH=${{ needs.build-prepare.outputs.components_branch }}
8072
platforms: linux/amd64,linux/386,linux/arm/v6,linux/arm/v7,linux/arm64,linux/riscv64
81-
push: true
73+
push: ${{ github.event_name != 'pull_request' }}
8274
set-meta-labels: true
8375
meta-images: |
8476
pihole/pihole

0 commit comments

Comments
 (0)