Skip to content

Check if the base Docker image has changed and then rebuild it #81

Check if the base Docker image has changed and then rebuild it

Check if the base Docker image has changed and then rebuild it #81

name: Check if the base Docker image has changed and then rebuild it
on:
schedule:
- cron: '45 5 * * *'
push:
branches:
- master
- dev-master
paths:
- .github/workflows/check-and-upgrade-image.yml
jobs:
setup:
uses: kyzima-spb/gh-actions/.github/workflows/read-matrix.yml@master
with:
path: ./.github/matrix.json
rebuild:
needs: setup
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Check base Docker Image
id: check
uses: kyzima-spb/docker-image-need-update-action@v1
with:
base-image: "debian:${{ matrix.release }}"
user-image: "${{ vars.IMAGE_NAME }}:${{ matrix.release }}"
-
if: ${{ steps.check.outputs.needRebuild }}
name: Rebuild Docker Image
uses: ./.github/actions/build-image
with:
image: ${{ vars.IMAGE_NAME }}
release: ${{ matrix.release }}
latest: ${{ matrix.latest }}
push: ${{ github.ref_name == 'master' }}
docker-username: ${{ secrets.DOCKER_HUB_USERNAME }}
docker-password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}