-
Notifications
You must be signed in to change notification settings - Fork 72
110 lines (106 loc) · 3.32 KB
/
build-lts-container-images.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Publish LTS Container Images
on:
push:
tags:
- '5.*'
jobs:
lint_dockerfiles:
name: 'Lint Dockerfile with hadolint'
runs-on: ubuntu-latest
strategy:
matrix:
dockerfile:
- 5.0/apache/Dockerfile
- 5.0/fpm-alpine/Dockerfile
- 5.0/fpm/Dockerfile
steps:
- uses: actions/checkout@v3
- uses: hadolint/[email protected]
with:
dockerfile: ${{ matrix.dockerfile }}
ignore: "DL4006,DL3008,DL3018"
push_images_to_registries:
name: 'Push container images to registries'
runs-on: ubuntu-latest
needs: [lint_dockerfiles]
environment: docker-build
permissions:
packages: write
contents: read
steps:
- name: 'Check out the repo'
uses: actions/checkout@v3
- name: 'Set up QEMU'
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'
- name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v2
with:
buildkitd-flags: --debug
- name: 'Log in to DockerHub'
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: 'Apache variant metadata'
id: metadata-apache
uses: docker/metadata-action@v4
with:
images: |
docker.io/martialblog/limesurvey
tags: |
type=match,pattern=(.+),group=1
type=match,pattern=^(\d+),group=1
flavor: |
latest=false
suffix=-apache
- name: 'Build and push LTS apache container images'
uses: docker/build-push-action@v4
with:
context: 5.0/apache
push: true
tags: ${{ steps.metadata-apache.outputs.tags }}
labels: ${{ steps.metadata-apache.outputs.labels }}
platforms: linux/amd64,linux/arm64
- name: 'FPM variant metadata'
id: metadata-fpm
uses: docker/metadata-action@v4
with:
images: |
docker.io/martialblog/limesurvey
tags: |
type=match,pattern=(.+),group=1
type=match,pattern=^(\d+),group=1
flavor: |
latest=false
suffix=-fpm
- name: 'Build and push LTS fpm container images'
uses: docker/build-push-action@v4
with:
context: 5.0/fpm
push: true
tags: ${{ steps.metadata-fpm.outputs.tags }}
labels: ${{ steps.metadata-apache.outputs.labels }}
platforms: linux/amd64,linux/arm64
- name: 'FPM Alpine variant metadata'
id: metadata-fpm-alpine
uses: docker/metadata-action@v4
with:
images: |
docker.io/martialblog/limesurvey
tags: |
type=match,pattern=(.+),group=1
type=match,pattern=^(\d+),group=1
flavor: |
latest=false
suffix=-fpm-alpine
- name: 'Build and push LTS fpm-alpine container images'
uses: docker/build-push-action@v4
with:
context: 5.0/fpm-alpine
push: true
tags: ${{ steps.metadata-fpm-alpine.outputs.tags }}
labels: ${{ steps.metadata-apache.outputs.labels }}
platforms: linux/amd64,linux/arm64