Build Docker Images #35
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: Build Docker Images | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
schedule: | |
- cron: '0 2 * * 0' # Weekly on Sundays at 02:00 | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build Docker Image | |
permissions: | |
contents: read | |
id-token: write | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Depot | |
uses: depot/setup-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker Metadata (Debian) | |
id: meta_debian | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/azuracast/icecast-kh-ac | |
flavor: latest=false | |
tags: | | |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} | |
type=raw,value=latest-debian,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} | |
type=ref,event=tag | |
- name: Publish to Docker Hub (Debian) | |
uses: depot/build-push-action@v1 | |
with: | |
context: . | |
file: Dockerfile.debian | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.meta_debian.outputs.tags }} | |
labels: ${{ steps.meta_debian.outputs.labels }} | |
- name: Build Docker Metadata (Alpine) | |
id: meta_alpine | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/azuracast/icecast-kh-ac | |
flavor: | | |
latest=false | |
suffix=-alpine | |
tags: | | |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} | |
type=ref,event=tag | |
- name: Publish to Docker Hub (Alpine) | |
uses: depot/build-push-action@v1 | |
with: | |
context: . | |
file: Dockerfile.alpine | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.meta_alpine.outputs.tags }} | |
labels: ${{ steps.meta_alpine.outputs.labels }} |