mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
Only cache docker images on dev branch (#6714)
This commit is contained in:
parent
ca5050d4a5
commit
47a1710b1e
1 changed files with 12 additions and 2 deletions
14
.github/actions/build-image/action.yaml
vendored
14
.github/actions/build-image/action.yaml
vendored
|
@ -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/build-push-action@v5.3.0
|
||||
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue