Dependency bumps #37
Workflow file for this run
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/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
with: | |
platforms: linux/arm64,linux/arm/v7 | |
- name: Log in to the GitHub container registry | |
if: github.event_name != 'pull_request' | |
uses: docker/[email protected] | |
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/[email protected] | |
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/[email protected] | |
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 }} |