Skip to content

Commit

Permalink
Update Dockerfile and build (#4)
Browse files Browse the repository at this point in the history
* Update Dockerfile

* Add multi-arch build

* Conditionnal push to release
  • Loading branch information
Passific authored Nov 25, 2024
1 parent 75955f9 commit 13983ed
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
name: Docker-build-n-push

on:
push:
tags: [ 'v*.*.*' ]
# push:
# tags: [ 'v*.*.*' ]
release:
types: [published]

jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64
permissions:
packages: write
steps:
Expand All @@ -28,9 +38,11 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
push: true
push: ${{ github.event.action == 'release' }}
platforms: ${{ matrix.platforms }}
tags: ghcr.io/${{ env.REPO }}:latest
build-args: |
BUILD_DATE=${{ github.event.repository.updated_at }}
BUILD_REF=$(git rev-parse --short HEAD)
BUILD_VERSION=${{ github.ref_name }}
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description="Track iPhones, or any device using Bonjour protocol, on the local network for Home Assistant."
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ ARG BUILD_VERSION
# OCI Meta information
LABEL \
org.opencontainers.image.authors="Axel LORENTE (https://github.com/Passific)" \
org.opencontainers.image.source="https://github.com/Passific/MQTT-iPhone-Tracker" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.version=${BUILD_VERSION} \
org.opencontainers.image.title="MQTT iPhone Tracker"
org.opencontainers.image.title="MQTT iPhone Tracker" \
org.opencontainers.image.description="Track iPhones, or any device using Bonjour protocol, on the local network for Home Assistant." \
org.opencontainers.image.licenses="GPL-3.0+"

VOLUME /opt/certs

Expand Down

0 comments on commit 13983ed

Please sign in to comment.