Skip to content

Commit 762391a

Browse files
Only export images locally on PRs:
Builds on PRs don't push images to a registry so they need to be passed on through GitHub Artifacts for future steps to succeed. Signed-off-by: Jacob Weinstock <[email protected]>
1 parent c418dfe commit 762391a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/build-all-matrix.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
env:
9797
DOCKER_ARCH: "${{ matrix.docker_arch }}"
9898
DO_PUSH: "${{ github.ref == 'refs/heads/main' && 'yes' || 'no' }}"
99-
EXPORT_LK_CONTAINERS: "yes"
99+
EXPORT_LK_CONTAINERS: "${{ github.event_name == 'pull_request' && 'yes' || 'no' }}" # Builds on PRs don't push images to a registry so they need to be passed on through GitHub Artifacts.
100100
EXPORT_LK_CONTAINERS_DIR: "${{ runner.temp }}"
101101
run: bash build.sh linuxkit-containers
102102

@@ -138,10 +138,10 @@ jobs:
138138
uses: docker/login-action@v3
139139
with: { registry: "ghcr.io", username: "${{ github.repository_owner }}", password: "${{ secrets.GITHUB_TOKEN }}" }
140140

141-
- name: Build and push Kernel ${{matrix.kernel}} (${{ matrix.arch }})
141+
- name: Build and Push and Export Kernel ${{matrix.kernel}} (${{ matrix.arch }})
142142
env:
143143
DO_PUSH: "${{ github.ref == 'refs/heads/main' && 'yes' || 'no' }}"
144-
EXPORT_KERNEL_IMAGE: "yes"
144+
EXPORT_KERNEL_IMAGE: "${{ github.event_name == 'pull_request' && 'yes' || 'no' }}" # Builds on PRs don't push images to a registry so they need to be passed on through GitHub Artifacts.
145145
EXPORT_KERNEL_IMAGE_DIR: "${{ runner.temp }}"
146146
run: bash build.sh build-kernel "${{ matrix.kernel }}"
147147

0 commit comments

Comments
 (0)