Skip to content

Updated readme and using {raw} vor semver tagging #303

Updated readme and using {raw} vor semver tagging

Updated readme and using {raw} vor semver tagging #303

name: Build and push docker image
on:
schedule:
- cron: "0 3 * * *"
push:
branches:
- main
env:
IMAGE_NAME: snapcast
NAMESPACE: sweisgerber
SNAPCAST_VERSION: 0.31
LIBRESPOT_VERSION: 0.6
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@v3
# BUILDX Setup
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# DockerHub Login
- name: Login to the Docker Hub registry
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@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]
with:
images: |
${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}
ghcr.io/${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}
tags: |
# set latest tag for default branch
type=schedule
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=v${{ env.SNAPCAST_VERSION }},enable={{is_default_branch}}
type=semver,pattern={{raw}},prefix=tag-
# 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@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
SNAPCAST_RELEASE=${{ env.SNAPCAST_VERSION }}
LIBRESPOT_RELEASE=${{ env.LIBRESPOT_VERSION }}
VERSION=snapcast-${{ env.SNAPCAST_VERSION }}-librespot-${{ env.LIBRESPOT_VERSION }}