-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (66 loc) · 2.53 KB
/
push_to_registry.yaml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Publish Docker image
on:
push:
branches: '**'
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: debian-mate:bookworm
file: debian-mate/bookworm/Dockerfile
platforms: linux/amd64, linux/arm64
tags: nggit/debian-mate:bookworm, nggit/debian-mate:latest
- name: debian-mate:bullseye
file: debian-mate/bullseye/Dockerfile
platforms: linux/amd64, linux/arm64
tags: nggit/debian-mate:bullseye
- name: debian-mate:buster
file: debian-mate/buster/Dockerfile
platforms: linux/amd64, linux/arm64
tags: nggit/debian-mate:buster
- name: debian-jwm:bookworm
file: debian-jwm/bookworm/Dockerfile
platforms: linux/amd64, linux/arm64
tags: nggit/debian-jwm:bookworm, nggit/debian-jwm:latest
- name: debian-jwm:bullseye
file: debian-jwm/bullseye/Dockerfile
platforms: linux/amd64, linux/arm64
tags: nggit/debian-jwm:bullseye
- name: debian-jwm:buster
file: debian-jwm/buster/Dockerfile
platforms: linux/amd64, linux/arm64
tags: nggit/debian-jwm:buster
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: List modified files
run: echo "FILES_MODIFIED=$( git diff --name-only HEAD HEAD^ )" >> $GITHUB_ENV
- name: Set up QEMU
if: ${{ contains(env.FILES_MODIFIED, '/Dockerfile') || github.event_name == 'schedule' }}
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: ${{ contains(env.FILES_MODIFIED, '/Dockerfile') || github.event_name == 'schedule' }}
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
if: ${{ contains(env.FILES_MODIFIED, '/Dockerfile') || github.event_name == 'schedule' }}
uses: docker/login-action@v2
with:
username: nggit
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push nggit/${{ matrix.name }}
if: ${{ contains(env.FILES_MODIFIED, matrix.file) || github.event_name == 'schedule' }}
uses: docker/build-push-action@v3
with:
context: .
file: ${{ matrix.file }}
push: true
tags: ${{ matrix.tags }}
platforms: ${{ matrix.platforms }}