Skip to content

Autoupdate build on base-image change (caddy) #470

Autoupdate build on base-image change (caddy)

Autoupdate build on base-image change (caddy) #470

name: Autoupdate build on base-image change (caddy)
# check if Base-Image library/caddy:alpine has been updated, if so do rebuild
on:
schedule:
- cron: '46 21 * * */2'
workflow_dispatch:
jobs:
check:
name: check for new release of caddy
runs-on: ubuntu-latest
outputs:
needs-updating: ${{ steps.check.outputs.needs-updating }}
steps:
- name: Check if update available
id: check
uses: lucacome/docker-image-update-checker@v1
with:
base-image: library/caddy:alpine
image: glopix/caddy-ionos-dns
build:
name: build new docker image
needs: check
if: needs.check.outputs.needs-updating == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# for multi architecture builds (x64, arm64, arm)
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:latest
platforms: arm64,arm
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: glopix/caddy-ionos-dns:latest
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}