Skip to content

Commit

Permalink
Merge pull request #15 from sweisgerber/feature/tagged-images
Browse files Browse the repository at this point in the history
Enabled VERSION and RELEASE Stings and using them as build-args
  • Loading branch information
sweisgerber authored Feb 9, 2025
2 parents d9d6e80 + b0c7541 commit 73186ce
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/build-and-push-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,36 @@ on:
env:
IMAGE_NAME: snapcast
NAMESPACE: sweisgerber
SNAPCAST_VERSION: 0.31.0-r0
LIBRESPOT_VERSION: 0.6.0-r0
jobs:
docker:
runs-on: ubuntu-latest
environment: main
steps:
# CHECKOUT
- name: Checkout
uses: actions/checkout@v3
# QEMU Setup
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
# BUILDX Setup
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
# DockerHub Login
- name: Login to the Docker Hub registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# GHCR Docker Login
- name: Log in to the ghcr Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Metadata
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
Expand All @@ -41,15 +49,21 @@ jobs:
tags: |
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=v${SNAPCAST_VERSION},enable={{is_default_branch}}
type=schedule
# type=ref,event=branch
type=ref,event=tag
# type=ref,event=pr
# Build & Push
- name: Build and push Docker images
uses: docker/build-push-action@v4.0.0
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
SNAPCAST_VERSION=${{ SNAPCAST_VERSION }}
LIBRESPOT_VERSION=${{ LIBRESPOT_VERSION }}
VERSION=snapcast-${{ SNAPCAST_VERSION }}-librespot-${{ LIBRESPOT_VERSION }}
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FROM ghcr.io/linuxserver/baseimage-alpine:edge
# set version label
ARG BUILD_DATE
ARG VERSION
ARG SNAPCAST_RELEASE
ARG LIBRESPOT_RELEASE

LABEL build_version="version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="sweisgerber"

Expand All @@ -13,9 +16,9 @@ RUN set -ex \
&& echo "**** install runtime packages ****" \
&& apk add --no-cache -U --upgrade \
alsa-utils \
librespot@testing \
librespot@testing=${LIBRESPOT_RELEASE} \
shairport-sync@testing \
snapcast \
snapcast=${SNAPCAST_RELEASE} \
snapweb@testing \
&& echo "**** cleanup ****" \
&& rm -rf \
Expand Down

0 comments on commit 73186ce

Please sign in to comment.