Skip to content

Build and publish Docker image #152

Build and publish Docker image

Build and publish Docker image #152

name: Build and publish Docker image
on:
schedule:
- cron: '0 0 * * MON'
push:
branches: [ main ]
paths-ignore: [ '**/README.md' ]
env:
IMAGE_NAME: liquidsoap
GITHUB_PACKAGES: ghcr.io
QUAY_IO: quay.io
jobs:
build_and_publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to GitHub Packages
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_PACKAGES }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Quay.io
uses: docker/login-action@v3
with:
registry: ${{ env.QUAY_IO }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Build and push Docker image with Liquidsoap 1.4.4
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
LIQUIDSOAP_VERSION=1.4.4
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:1.4.4
${{ env.GITHUB_PACKAGES }}/${{ github.actor }}/${{ env.IMAGE_NAME }}:1.4.4
${{ env.QUAY_IO }}/${{ secrets.QUAY_USERNAME }}/${{ env.IMAGE_NAME }}:1.4.4
- name: Build and push Docker image with Liquidsoap 2.0.0
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
LIQUIDSOAP_VERSION=2.0.0
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:2.0.0
${{ env.GITHUB_PACKAGES }}/${{ github.actor }}/${{ env.IMAGE_NAME }}:2.0.0
${{ env.QUAY_IO }}/${{ secrets.QUAY_USERNAME }}/${{ env.IMAGE_NAME }}:2.0.0
- name: Build and push Docker image with the latest version of Liquidsoap
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
${{ env.GITHUB_PACKAGES }}/${{ github.actor }}/${{ env.IMAGE_NAME }}:latest
${{ env.QUAY_IO }}/${{ secrets.QUAY_USERNAME }}/${{ env.IMAGE_NAME }}:latest