From 302e8b51c03a3599030b6492002254aefca55da3 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Thu, 5 Dec 2024 22:02:43 +0900 Subject: [PATCH] chore(.github): skip `free-disk-space` action if there are no changed files (#5536) skip free-disk-space action Signed-off-by: Yutaka Kondo --- .../workflows/docker-build-and-push-arm64.yaml | 18 ++++++++++++------ .github/workflows/docker-build-and-push.yaml | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docker-build-and-push-arm64.yaml b/.github/workflows/docker-build-and-push-arm64.yaml index 7242629c59..167c1d7ebf 100644 --- a/.github/workflows/docker-build-and-push-arm64.yaml +++ b/.github/workflows/docker-build-and-push-arm64.yaml @@ -29,9 +29,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - - name: Free disk space - uses: ./.github/actions/free-disk-space - - name: Get changed files id: changed-files uses: tj-actions/changed-files@v45 @@ -45,6 +42,12 @@ jobs: ansible/** docker/** + - name: Free disk space + if: ${{ steps.changed-files.outputs.any_changed == 'true' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref_type == 'tag') }} + uses: ./.github/actions/free-disk-space + - name: Build 'Autoware' without CUDA if: ${{ steps.changed-files.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch' || @@ -81,9 +84,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - - name: Free disk space - uses: ./.github/actions/free-disk-space - - name: Get changed files id: changed-files uses: tj-actions/changed-files@v45 @@ -97,6 +97,12 @@ jobs: ansible/** docker/** + - name: Free disk space + if: ${{ steps.changed-files.outputs.any_changed == 'true' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref_type == 'tag') }} + uses: ./.github/actions/free-disk-space + - name: Build 'Autoware' with CUDA if: ${{ steps.changed-files.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch' || diff --git a/.github/workflows/docker-build-and-push.yaml b/.github/workflows/docker-build-and-push.yaml index 280fe2efbb..567678bde3 100644 --- a/.github/workflows/docker-build-and-push.yaml +++ b/.github/workflows/docker-build-and-push.yaml @@ -24,9 +24,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - - name: Free disk space - uses: ./.github/actions/free-disk-space - - name: Get changed files id: changed-files uses: tj-actions/changed-files@v45 @@ -40,6 +37,12 @@ jobs: ansible/** docker/** + - name: Free disk space + if: ${{ steps.changed-files.outputs.any_changed == 'true' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref_type == 'tag') }} + uses: ./.github/actions/free-disk-space + - name: Build 'Autoware' without CUDA if: ${{ steps.changed-files.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch' || @@ -76,9 +79,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - - name: Free disk space - uses: ./.github/actions/free-disk-space - - name: Get changed files id: changed-files uses: tj-actions/changed-files@v45 @@ -92,6 +92,12 @@ jobs: ansible/** docker/** + - name: Free disk space + if: ${{ steps.changed-files.outputs.any_changed == 'true' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref_type == 'tag') }} + uses: ./.github/actions/free-disk-space + - name: Build 'Autoware' with CUDA if: ${{ steps.changed-files.outputs.any_changed == 'true' || github.event_name == 'workflow_dispatch' ||