-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.34 KB
/
check-and-upgrade-image.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
47
48
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 }}