Skip to content

Commit a8a3270

Browse files
authored
feat(ci): save GitHub Actions cache only on the main branch (#4975)
update condition Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
1 parent 0a1e1a9 commit a8a3270

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/actions/docker-build/action.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ runs:
3737
# TODO(youtalk): Remove obsolete "cache-" restore-keys
3838
- name: Cache ccache
3939
uses: actions/cache@v4
40-
if: ${{ inputs.name == 'no-cuda' }}
40+
if: ${{ inputs.name == 'no-cuda' && github.ref == 'refs/heads/main' }}
4141
id: cache-ccahce
4242
with:
4343
path: |
@@ -51,7 +51,7 @@ runs:
5151
5252
- name: Cache apt-get
5353
uses: actions/cache@v4
54-
if: ${{ inputs.name == 'no-cuda' }}
54+
if: ${{ inputs.name == 'no-cuda' && github.ref == 'refs/heads/main' }}
5555
id: cache-apt-get
5656
with:
5757
path: |
@@ -65,7 +65,7 @@ runs:
6565
# TODO(youtalk): Remove obsolete "cache-" restore-keys
6666
- name: Restore ccache
6767
uses: actions/cache/restore@v4
68-
if: ${{ inputs.name != 'no-cuda' }}
68+
if: ${{ inputs.name != 'no-cuda' || github.ref != 'refs/heads/main' }}
6969
with:
7070
path: |
7171
root-ccache
@@ -78,7 +78,7 @@ runs:
7878
7979
- name: Restore apt-get
8080
uses: actions/cache/restore@v4
81-
if: ${{ inputs.name != 'no-cuda' }}
81+
if: ${{ inputs.name != 'no-cuda' || github.ref != 'refs/heads/main' }}
8282
with:
8383
path: |
8484
var-cache-apt

0 commit comments

Comments
 (0)