Bump docker/build-push-action from 6.9.0 to 6.13.0 #48
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
name: Build ESPHome base container image | |
on: | |
pull_request: | |
branches: [main] | |
release: | |
types: [published] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
name: Build ${{ matrix.base }} image | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
base: | |
- debian | |
- alpine | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.2.2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3.8.0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3.2.0 | |
with: | |
platforms: linux/arm64,linux/arm/v7 | |
- name: Log in to the GitHub container registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get tag | |
id: get_tag | |
run: |- | |
if [[ "${{ github.event_name }}" = "release" ]]; then | |
version="${{ github.event.release.tag_name}}" | |
elif [[ "${{ github.event_name }}" = "pull_request" ]]; then | |
version="pr-${{ github.event.pull_request.number }}" | |
else | |
version=${GITHUB_REF#refs/heads/} | |
version=${version//\//-} | |
fi | |
echo version="$version" >> $GITHUB_OUTPUT | |
- name: Build base image | |
uses: docker/build-push-action@v6.13.0 | |
env: | |
DOCKER_BUILD_SUMMARY: false | |
DOCKER_BUILD_RECORD_UPLOAD: false | |
with: | |
context: ${{ matrix.base }} | |
file: ./${{ matrix.base }}/Dockerfile | |
platforms: linux/amd64,linux/arm/v7,linux/arm64 | |
target: docker | |
cache-from: type=registry,ref=ghcr.io/esphome/docker-base:cache-${{ matrix.base }} | |
cache-to: ${{ github.event_name == 'release' && format('type=registry,ref=ghcr.io/esphome/docker-base:cache-{0},mode=max', matrix.base) || '' }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
ghcr.io/esphome/docker-base:${{ matrix.base }}-${{ steps.get_tag.outputs.version }} | |
- name: Build ha-addon image | |
uses: docker/build-push-action@v6.13.0 | |
env: | |
DOCKER_BUILD_SUMMARY: false | |
DOCKER_BUILD_RECORD_UPLOAD: false | |
with: | |
context: ${{ matrix.base }} | |
file: ./${{ matrix.base }}/Dockerfile | |
platforms: linux/amd64,linux/arm/v7,linux/arm64 | |
target: ha-addon | |
cache-from: type=registry,ref=ghcr.io/esphome/docker-base:cache-${{ matrix.base }} | |
cache-to: ${{ github.event_name == 'release' && format('type=registry,ref=ghcr.io/esphome/docker-base:cache-{0},mode=max', matrix.base) || '' }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
ghcr.io/esphome/docker-base:${{ matrix.base }}-ha-addon-${{ steps.get_tag.outputs.version }} |