on:
release:
- types: [ published ]
+ types: [ ]
+env:
+ DOCKER_PLATFORMS: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
+
jobs:
main:
runs-on: ubuntu-latest
- name: Set SHAIRPORT_SYNC_BRANCH env.
run: echo "SHAIRPORT_SYNC_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- - name: Set up ssh agent
- uses: webfactory/ssh-agent@v0.5.2 # Can be removed when no longer pulling from private repos.
- with:
- ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
-
+ - name: Determine NQPTP env (part 1).
+ if: ${{ env.SHAIRPORT_SYNC_BRANCH == 'development' }}
+ run: echo "NQPTP_BRANCH=development" >> $GITHUB_ENV
+
+ - name: Determine NQPTP env (part 2).
+ if: ${{ env.SHAIRPORT_SYNC_BRANCH != 'development' }}
+ run: echo "NQPTP_BRANCH=master" >> $GITHUB_ENV
+
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Login to Docker Registry
uses: docker/login-action@v1
with:
- registry: registry.nova.do
+ registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
with:
context: ./
file: ./docker/Dockerfile
- platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
+ platforms: ${{ env.PLATFORMS }}
push: true
- tags: registry.nova.do/shairport-sync:latest registry.nova.do/shairport-sync:${{ github.event.release.tag_name }}
+ tags: ${{ secrets.DOCKER_IMAGE_NAME }}:latest ${{ secrets.DOCKER_IMAGE_NAME }}:${{ github.event.release.tag_name }}
build-args: |
SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
- ssh: default=${{ env.SSH_AUTH_SOCK }} # Can be removed when no longer pulling from private repos.
+ NQPTP_BRANCH=${{ env.NQPTP_BRANCH }}
- name: Build and push (AirPlay 1)
uses: docker/build-push-action@v2
with:
context: ./
file: ./docker/airplay1/Dockerfile-AirPlay1
- platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
+ platforms: ${{ env.PLATFORMS }}
push: true
- tags: registry.nova.do/shairport-sync:latest-airplay1, registry.nova.do/shairport-sync:${{ github.event.release.tag_name }}-airplay1
+ tags: ${{ secrets.DOCKER_IMAGE_NAME }}:latest-airplay1, ${{ secrets.DOCKER_IMAGE_NAME }}:${{ github.event.release.tag_name }}-airplay1
build-args: |
SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
\ No newline at end of file
# Builds & pushes a docker image when a commit is made to one of the branches specified below.
-# Tag pattern: 'unstable-[BRANCH NAME]'.
+# Tag pattern: 'unstable-[BRANCH NAME]' & 'unstable-[BRANCH NAME]-airplay1'
# See docker-build-releases.yaml for release build process.
name: Build and push docker image based on commit to specified branches.
on:
push:
branches: [ master, development, charles-dev ]
+
+env:
+ DOCKER_PLATFORMS: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
jobs:
main:
- name: Set SHAIRPORT_SYNC_BRANCH env.
run: echo "SHAIRPORT_SYNC_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- - name: Set up ssh agent
- uses: webfactory/ssh-agent@v0.5.2 # Can be removed when no longer pulling from private repos.
- with:
- ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
-
+ - name: Determine NQPTP env (part 1).
+ if: ${{ env.SHAIRPORT_SYNC_BRANCH == 'development' }}
+ run: echo "NQPTP_BRANCH=development" >> $GITHUB_ENV
+
+ - name: Determine NQPTP env (part 2).
+ if: ${{ env.SHAIRPORT_SYNC_BRANCH != 'development' }}
+ run: echo "NQPTP_BRANCH=master" >> $GITHUB_ENV
+
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Login to Docker Registry
uses: docker/login-action@v1
with:
- registry: registry.nova.do
+ registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
with:
context: ./
file: ./docker/Dockerfile
- platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
+ platforms: ${{ env.DOCKER_PLATFORMS }}
push: true
- tags: registry.nova.do/shairport-sync:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }}
+ tags: ${{ secrets.DOCKER_IMAGE_NAME }}:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }}
build-args: |
SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
- ssh: default=${{ env.SSH_AUTH_SOCK }} # Can be removed when no longer pulling from private repos.
+ NQPTP_BRANCH=${{ env.NQPTP_BRANCH }}
- name: Build and push (AirPlay 1)
uses: docker/build-push-action@v2
with:
context: ./
file: ./docker/airplay1/Dockerfile
- platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7
+ platforms: ${{ env.DOCKER_PLATFORMS }}
push: true
- tags: registry.nova.do/shairport-sync:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }}-airplay1
+ tags: ${{ secrets.DOCKER_IMAGE_NAME }}:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }}-airplay1
build-args: |
SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }}
\ No newline at end of file
# Shairport Sync Build System:
FROM builder-base AS builder-sps
-# This will be modified by the Github Action Workflow and is required
-# to ensure the correct branch is being used.
+# These will be modified by the Github Action Workflow and are required
+# to ensure the correct branches are being used.
ARG SHAIRPORT_SYNC_BRANCH
RUN test -n "$SHAIRPORT_SYNC_BRANCH"
+ARG NQPTP_BRANCH
+RUN test -n "$NQPTP_BRANCH"
COPY --from=builder-alac /usr/local/lib/libalac.* /usr/local/lib/
COPY --from=builder-alac /usr/local/lib/pkgconfig/alac.pc /usr/local/lib/pkgconfig/alac.pc
COPY --from=builder-alac /usr/local/include /usr/local/include
-# TODO: Remove when no longer pulling from private repos.
-RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
-
-RUN --mount=type=ssh git clone git@github.com:mikebrady/nqptp.git
+RUN git clone https://github.com/mikebrady/nqptp
WORKDIR /nqptp
# Use development branch for now.
-RUN git checkout development
+RUN git checkout "$NQPTP_BRANCH"
RUN autoreconf -fi
RUN ./configure
RUN make
## Build Example (for arm7 devices)
-TODO: remove `--ssh` when going public as this is only for private repos.
```
-docker buildx build --ssh default=$SSH_AUTH_SOCK --platform linux/arm/v7 -f ./docker/Dockerfile --build-arg SHAIRPORT_SYNC_BRANCH=development -t registry.nova.do/shairport-sync:unstable-development .
+docker buildx build --platform linux/arm/v7 -f ./docker/Dockerfile --build-arg SHAIRPORT_SYNC_BRANCH=development --build-arg NQPTP_BRANCH=development -t shairport-sync:unstable-development .
```
`SHAIRPORT_SYNC_BRANCH` is required to ensure the image is built using the expected branch.
## AirPlay 1 Only
-The AirPlay1 only dockerfile is in the `airplay1` folder. This also includes the `start.sh` script used by the container.
\ No newline at end of file
+
+The AirPlay1 only dockerfile is in the `airplay1` folder. This also includes the `start.sh` script used by the container. Please note that the AirPlay 1 image build via the AirPlay 2 branch does not work with multiple instances on the same hardware.
+
+## GitHub Action Builds
+
+Requires the following secrets to be set in the repo:
+- `DOCKER_REGISTRY` - docker.io if using Docker Hub, else set to your registry URL.
+- `DOCKER_REGISTRY_TOKEN` - Access token for your registry.
+- `DOCKER_REGISTRY_USER` - Login user for your registry.
+- `DOCKER_IMAGE_NAME` - The name of the image, for example `your-registry.com/shairport-sync` or just `your-username/shairport-sync` if using Docker Hub.
\ No newline at end of file
# AirPlay 1 Only Docker Image
-See the [Shairport Sync Docker Hub Repo](https://hub.docker.com/r/mikebrady/shairport-sync) for available tags. For the latest build, use `latest-airplay1`.
\ No newline at end of file
+See the [Shairport Sync Docker Hub Repo](https://hub.docker.com/r/mikebrady/shairport-sync) for available tags.
services:
shairport-sync:
- image: registry.nova.do/shairport-sync:unstable-development
+ image: mikebrady/shairport-sync:unstable-development
network_mode: host
restart: unless-stopped
devices: