From a8a3270d81ecc90d66b090e51393d42eeb845fe0 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Fri, 12 Jul 2024 18:22:27 +0900 Subject: [PATCH] feat(ci): save GitHub Actions cache only on the `main` branch (#4975) update condition Signed-off-by: Yutaka Kondo --- .github/actions/docker-build/action.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/docker-build/action.yaml b/.github/actions/docker-build/action.yaml index 2f0849fb0ce..ed992a8a1ba 100644 --- a/.github/actions/docker-build/action.yaml +++ b/.github/actions/docker-build/action.yaml @@ -37,7 +37,7 @@ runs: # TODO(youtalk): Remove obsolete "cache-" restore-keys - name: Cache ccache uses: actions/cache@v4 - if: ${{ inputs.name == 'no-cuda' }} + if: ${{ inputs.name == 'no-cuda' && github.ref == 'refs/heads/main' }} id: cache-ccahce with: path: | @@ -51,7 +51,7 @@ runs: - name: Cache apt-get uses: actions/cache@v4 - if: ${{ inputs.name == 'no-cuda' }} + if: ${{ inputs.name == 'no-cuda' && github.ref == 'refs/heads/main' }} id: cache-apt-get with: path: | @@ -65,7 +65,7 @@ runs: # TODO(youtalk): Remove obsolete "cache-" restore-keys - name: Restore ccache uses: actions/cache/restore@v4 - if: ${{ inputs.name != 'no-cuda' }} + if: ${{ inputs.name != 'no-cuda' || github.ref != 'refs/heads/main' }} with: path: | root-ccache @@ -78,7 +78,7 @@ runs: - name: Restore apt-get uses: actions/cache/restore@v4 - if: ${{ inputs.name != 'no-cuda' }} + if: ${{ inputs.name != 'no-cuda' || github.ref != 'refs/heads/main' }} with: path: | var-cache-apt