Skip to content

⬆️ Update dependency mikefarah/yq to v4.52.5 (#17) #132

⬆️ Update dependency mikefarah/yq to v4.52.5 (#17)

⬆️ Update dependency mikefarah/yq to v4.52.5 (#17) #132

Workflow file for this run

name: Builder
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
name: Build
strategy:
matrix:
arch: ["aarch64", "amd64", "armhf", "armv7", "i386"]
fail-fast: false
steps:
- name: Check out repository
uses: actions/checkout@v6.0.2
- name: Authenticate GitHub Container Registry
# if: env.BUILD_ARGS != '--test'
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }} # or github.repository_owner
password: ${{ secrets.HA_GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4.0.0
- name: Set BUILD_FROM, PLATFORM, and VERSION variables
run: |
BUILD_FROM=$(yq e ".build_from.${{ matrix.arch }}" ./${{ matrix.addon }}/build.yaml)
[ "${{ matrix.arch }}" == "armv7" ] && PLATFORM="arm/v7" || PLATFORM="${{ matrix.arch }}"
VERSION=$(yq e ".version" ./${{ matrix.addon }}/config.yaml)
echo "BUILD_FROM=${BUILD_FROM}" >> $GITHUB_ENV
echo "PLATFORM=${PLATFORM}" >> $GITHUB_ENV
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "REPO_NAME_LC=$(echo ${GITHUB_REPOSITORY} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Build and push Docker images
run: |
docker buildx build --platform linux/${{ env.PLATFORM }} \
--build-arg BUILD_FROM=${{ env.BUILD_FROM }} \
--build-arg REPO_URL=https://github.com/${{ env.REPO_NAME_LC }} \
--build-arg VERSION=${{ env.VERSION }} \
--build-arg PLATFORM=${{ env.PLATFORM }} \
--build-arg ARCH=${{ matrix.arch }} \
--push \
-t ghcr.io/${{ env.REPO_NAME_LC }}-${{ matrix.arch }}:${{ env.VERSION }} \
-t ghcr.io/${{ env.REPO_NAME_LC }}-${{ matrix.arch }}:latest .