Skip to content

Multi-Arch Build - Master #132

Multi-Arch Build - Master

Multi-Arch Build - Master #132

Workflow file for this run

name: Multi-Arch Build - Master
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 2 * * 6'
jobs:
build-master:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup qemu
uses: docker/setup-qemu-action@v2
- name: Setup buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Prepare build and tags
id: prepare
run: |
DOCKER_IMAGE=1activegeek/airconnect
DOCKER_PLATFORMS=linux/amd64,linux/arm64
# linux/arm/v7 removed as deprecated by ls.io
VERSION=$(curl -s https://api.github.com/repos/philippe44/AirConnect/releases/latest | grep tag_name | cut -d '"' -f 4)
TAGS="--tag ${DOCKER_IMAGE}:${VERSION} --tag ${DOCKER_IMAGE}:latest"
echo "docker_image=${DOCKER_IMAGE}" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "buildx_args=--platform ${DOCKER_PLATFORMS} \
--build-arg VERSION=${VERSION} \
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg VCS_REF=${GITHUB_SHA::8} \
${TAGS} --file ./Dockerfile ./" >> $GITHUB_OUTPUT
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build and Push
if: github.event_name != 'pull_request'
run: |
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
- name: Inspect Image
if: github.event_name != 'pull_request'
run: |
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}