Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4.2.2...v5.0.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
81 lines
2.5 KiB
YAML
81 lines
2.5 KiB
YAML
# Builds a docker image when a commit is made. Also pushes the build if the branch is 'master' or 'development'.
|
||
|
||
# Tag pattern
|
||
# 'master' - rolling, rolling-classic
|
||
# 'development' - development, development-classic
|
||
|
||
name: docker-build-on-push.yaml
|
||
|
||
on:
|
||
workflow_dispatch:
|
||
push:
|
||
branches:
|
||
- master
|
||
- development
|
||
pull_request:
|
||
types: [opened, synchronize, reopened, ready_for_review]
|
||
|
||
env:
|
||
DOCKER_PLATFORMS: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
|
||
NQPTP_BRANCH: main
|
||
|
||
jobs:
|
||
build-and-publish:
|
||
if: github.event_name != 'pull_request'
|
||
runs-on: ubuntu-22.04
|
||
steps:
|
||
- name: Checkout
|
||
uses: actions/checkout@v5.0.0
|
||
with:
|
||
fetch-depth: 0
|
||
|
||
- name: Set SHAIRPORT_SYNC_BRANCH env.
|
||
run: echo "SHAIRPORT_SYNC_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||
|
||
- name: Is branch "master"?
|
||
if: ${{ env.SHAIRPORT_SYNC_BRANCH == 'master' }}
|
||
run: |
|
||
echo "IMAGE_TAG_BASE=rolling" >> $GITHUB_ENV
|
||
|
||
- name: Is branch "development"?
|
||
if: ${{ env.SHAIRPORT_SYNC_BRANCH == 'development' }}
|
||
run: |
|
||
echo "NQPTP_BRANCH=development" >> $GITHUB_ENV
|
||
echo "IMAGE_TAG_BASE=development" >> $GITHUB_ENV
|
||
|
||
- name: Set up QEMU
|
||
uses: docker/setup-qemu-action@v3.6.0
|
||
|
||
- name: Set up Docker Buildx
|
||
uses: docker/setup-buildx-action@v3.11.1
|
||
|
||
- name: Login to Docker Registry
|
||
uses: docker/login-action@v3.5.0
|
||
with:
|
||
registry: ${{ secrets.DOCKER_REGISTRY }}
|
||
username: ${{ secrets.DOCKER_REGISTRY_USER }}
|
||
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
|
||
|
||
- name: Build and Push (Classic)
|
||
uses: docker/build-push-action@v6.18.0
|
||
with:
|
||
context: ./
|
||
file: ./docker/classic/Dockerfile
|
||
platforms: ${{ env.DOCKER_PLATFORMS }}
|
||
push: ${{ env.IMAGE_TAG_BASE != '' }}
|
||
tags: ${{ secrets.DOCKER_IMAGE_NAME }}:${{ env.IMAGE_TAG_BASE }}-classic
|
||
build-args: |
|
||
SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
|
||
|
||
- name: Build and Push (AirPlay 2)
|
||
uses: docker/build-push-action@v6.18.0
|
||
with:
|
||
context: ./
|
||
file: ./docker/Dockerfile
|
||
platforms: ${{ env.DOCKER_PLATFORMS }}
|
||
push: ${{ env.IMAGE_TAG_BASE != '' }}
|
||
tags: ${{ secrets.DOCKER_IMAGE_NAME }}:${{ env.IMAGE_TAG_BASE }}
|
||
build-args: |
|
||
SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
|
||
NQPTP_BRANCH=${{ env.NQPTP_BRANCH }}
|