Merge branch 'master' into reader-1.11.3 #162
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: DSMR Reader | |
# Controls when the workflow will run | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'master' | |
- 'reader-1.11.3' | |
tags: | |
- '*.*.*' | |
paths: | |
- 'dsmr_reader/Dockerfile' | |
- 'dsmr_reader/rootfs/**' | |
- .github/workflows/dsmr-reader.yml | |
jobs: | |
dsmr-reader: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
# AMD64 | |
- DOCKER_TAG_SUFFIX: amd64 | |
S6_ARCH: amd64 | |
BASE_IMAGE: ghcr.io/xirixiz/dsmr-reader-docker:5.11.0-2024.04.03 | |
PLATFORMS: linux/amd64 | |
QEMU_ARCH: x86_64 | |
# ARM32V6 | |
- DOCKER_TAG_SUFFIX: armhf | |
S6_ARCH: armhf | |
BASE_IMAGE: ghcr.io/xirixiz/dsmr-reader-docker:5.11.0-2024.04.03 | |
PLATFORMS: linux/arm/v6 | |
QEMU_ARCH: arm | |
# ARM32V7 | |
- DOCKER_TAG_SUFFIX: armv7 | |
S6_ARCH: armv7 | |
BASE_IMAGE: ghcr.io/xirixiz/dsmr-reader-docker:5.11.0-2024.04.03 | |
PLATFORMS: linux/arm/v7 | |
QEMU_ARCH: arm | |
# ARM64V8 | |
- DOCKER_TAG_SUFFIX: aarch64 | |
S6_ARCH: aarch64 | |
BASE_IMAGE: ghcr.io/xirixiz/dsmr-reader-docker:5.11.0-2024.04.03 | |
PLATFORMS: linux/arm64/v8 | |
QEMU_ARCH: aarch64 | |
steps: | |
# Get the repository's code | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# https://github.com/docker/setup-qemu-action | |
- name: Get the version from config.json | |
id: data | |
run: | | |
version=$(jq --raw-output '.version' ./dsmr_reader/config.json) | |
echo "HA_RELEASE=$version" >> "$GITHUB_OUTPUT" | |
- name: DSMR addon release | |
env: | |
HA_RELEASE: ${{ steps.data.outputs.HA_RELEASE }} | |
run: echo "$HA_RELEASE" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker meta | |
id: meta # you'll use this in the next step | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
sanderdw/ha-dsmr-reader-${{ matrix.DOCKER_TAG_SUFFIX }} | |
# Docker tags based on the following events/attributes | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=raw,value=${{ steps.data.outputs.HA_RELEASE }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./dsmr_reader | |
platforms: ${{ matrix.PLATFORMS }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
BUILD_FROM=${{matrix.BASE_IMAGE}} | |
HA_RELEASE=${{ steps.data.outputs.HA_RELEASE }} | |
BUILD_ARCH=${{matrix.S6_ARCH}} |