Skip to content

Commit bbdfafb

Browse files
committed
Do not clean up GitHub Action workers if no Docker build is needed
1 parent 9b5d26e commit bbdfafb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
version: ${{ fromJson(needs.list_base_images.outputs.versions) }}
4646
steps:
4747
- name: Free Disk Space (Ubuntu)
48+
if: ${{ needs.list_base_images.outputs.base_has_changed == 'true' }}
4849
uses: jlumbroso/free-disk-space@main
4950
with:
5051
# this might remove tools that are actually needed,
@@ -61,15 +62,18 @@ jobs:
6162
swap-storage: true
6263

6364
- name: Login to Docker Hub
65+
if: ${{ needs.list_base_images.outputs.base_has_changed == 'true' }}
6466
uses: docker/login-action@v2
6567
with:
6668
username: ${{ secrets.DOCKERHUB_USERNAME }}
6769
password: ${{ secrets.DOCKERHUB_TOKEN }}
6870

6971
- name: Set up QEMU
72+
if: ${{ needs.list_base_images.outputs.base_has_changed == 'true' }}
7073
uses: docker/setup-qemu-action@v3
7174

7275
- name: Enable multi-platform builds
76+
if: ${{ needs.list_base_images.outputs.base_has_changed == 'true' }}
7377
uses: docker/setup-buildx-action@v3
7478
with:
7579
name: container
@@ -81,11 +85,6 @@ jobs:
8185
run: ./generate_tags.sh
8286
working-directory: base
8387

84-
- name: Base Images > Docker Build Tags
85-
run: DOCKER_REPOSITORY=${{ vars.DOCKER_BASE_REPOSITORY}} ./docker_tags.sh --version ${{ matrix.version }}
86-
if: ${{ github.event_name == 'pull_request' }}
87-
working-directory: base
88-
8988
- name: Base Images > Docker Build & Force Push
9089
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && needs.list_base_images.outputs.base_has_changed == 'true' }}
9190
run: DOCKER_REPOSITORY=${{ vars.DOCKER_BASE_REPOSITORY}} ./docker_tags.sh -p -f --version ${{ matrix.version }}
@@ -114,6 +113,7 @@ jobs:
114113
- 'images/${{ matrix.ps-version }}/**'
115114
116115
- name: Free Disk Space (Ubuntu)
116+
if: ${{ (needs.list_base_images.outputs.base_has_changed == 'true' || steps.filter.outputs.image_has_changed == 'true') }}
117117
uses: jlumbroso/free-disk-space@main
118118
with:
119119
# this might remove tools that are actually needed,

0 commit comments

Comments
 (0)