-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.41 KB
/
auto-build-on-base-image-change.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Regular base image update check
# SOURCE: https://www.flypenguin.de/2021/07/30/auto-rebuild-docker-images-if-base-image-changes-using-github-actions/
on:
push:
branches: [ main ]
schedule:
- cron: "13 23 * * 5"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker Image Update Checker
id: baseupdatecheck
uses: lucacome/[email protected]
with:
base-image: library/caddy:alpine
image: cryorig/caddyflare
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
if: steps.baseupdatecheck.outputs.needs-updating == 'true'
- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
context: "${{ github.workspace }}"
push: true
tags: cryorig/caddyflare:latest
outputs: type=image,compression=gzip
if: steps.baseupdatecheck.outputs.needs-updating == 'true'
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
short-description: ${{ github.event.repository.description }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: cryorig/caddyflare