Skip to content

Commit

Permalink
feat(ci): save GitHub Actions cache only on the main branch (#4975)
Browse files Browse the repository at this point in the history
update condition

Signed-off-by: Yutaka Kondo <[email protected]>
  • Loading branch information
youtalk authored Jul 12, 2024
1 parent 0a1e1a9 commit a8a3270
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/actions/docker-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a8a3270

Please sign in to comment.