From 56a1f94a00f7154ce4086a6d75c8695d9353bc8d Mon Sep 17 00:00:00 2001 From: Thomas Nabord Date: Tue, 24 Mar 2026 12:41:38 +0000 Subject: [PATCH] Do not clean up GitHub Action workers if no Docker build is needed --- .github/workflows/publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f26dc962..9d07c869 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -45,6 +45,7 @@ jobs: version: ${{ fromJson(needs.list_base_images.outputs.versions) }} steps: - name: Free Disk Space (Ubuntu) + if: ${{ needs.list_base_images.outputs.base_has_changed == 'true' }} uses: jlumbroso/free-disk-space@main with: # this might remove tools that are actually needed, @@ -61,15 +62,18 @@ jobs: swap-storage: true - name: Login to Docker Hub + if: ${{ needs.list_base_images.outputs.base_has_changed == 'true' }} uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up QEMU + if: ${{ needs.list_base_images.outputs.base_has_changed == 'true' }} uses: docker/setup-qemu-action@v3 - name: Enable multi-platform builds + if: ${{ needs.list_base_images.outputs.base_has_changed == 'true' }} uses: docker/setup-buildx-action@v3 with: name: container @@ -81,11 +85,6 @@ jobs: run: ./generate_tags.sh working-directory: base - - name: Base Images > Docker Build Tags - run: DOCKER_REPOSITORY=${{ vars.DOCKER_BASE_REPOSITORY}} ./docker_tags.sh --version ${{ matrix.version }} - if: ${{ github.event_name == 'pull_request' }} - working-directory: base - - name: Base Images > Docker Build & Force Push if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && needs.list_base_images.outputs.base_has_changed == 'true' }} run: DOCKER_REPOSITORY=${{ vars.DOCKER_BASE_REPOSITORY}} ./docker_tags.sh -p -f --version ${{ matrix.version }} @@ -114,6 +113,7 @@ jobs: - 'images/${{ matrix.ps-version }}/**' - name: Free Disk Space (Ubuntu) + if: ${{ (needs.list_base_images.outputs.base_has_changed == 'true' || steps.filter.outputs.image_has_changed == 'true') }} uses: jlumbroso/free-disk-space@main with: # this might remove tools that are actually needed,