forked from esphome/esphome
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only cache docker images on dev branch (esphome#6714)
- Loading branch information
1 parent
ca5050d
commit 47a1710
Showing
1 changed file
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,16 @@ runs: | |
echo $l >> $GITHUB_OUTPUT | ||
done | ||
# set cache-to only if dev branch | ||
- id: cache-to | ||
shell: bash | ||
run: |- | ||
if [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then | ||
echo "value=type=gha,mode=max" >> $GITHUB_OUTPUT | ||
else | ||
echo "value=" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Build and push to ghcr by digest | ||
id: build-ghcr | ||
uses: docker/[email protected] | ||
|
@@ -43,7 +53,7 @@ runs: | |
platforms: ${{ inputs.platform }} | ||
target: ${{ inputs.target }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
cache-to: ${{ steps.cache-to.outputs.value }} | ||
build-args: | | ||
BASEIMGTYPE=${{ inputs.baseimg }} | ||
BUILD_VERSION=${{ inputs.version }} | ||
|
@@ -66,7 +76,7 @@ runs: | |
platforms: ${{ inputs.platform }} | ||
target: ${{ inputs.target }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
cache-to: ${{ steps.cache-to.outputs.value }} | ||
build-args: | | ||
BASEIMGTYPE=${{ inputs.baseimg }} | ||
BUILD_VERSION=${{ inputs.version }} | ||
|