9
9
- v*.*.*-pre.* # pre release like, v0.19.0-pre.calendardate
10
10
pull_request :
11
11
paths :
12
- - ' Dockerfile'
12
+ - ' Dockerfile.alpine '
13
13
- ' .github/workflows/atlantis-image.yml'
14
14
workflow_dispatch :
15
15
@@ -19,12 +19,18 @@ concurrency:
19
19
20
20
jobs :
21
21
build :
22
+ strategy :
23
+ matrix :
24
+ image_type : [alpine]
22
25
runs-on : ubuntu-22.04
23
26
env :
24
27
RELEASE_TYPE : ${{ contains(github.ref, 'pre') && 'pre' || 'stable' }}
25
28
RELEASE_TAG : ${{ contains(github.ref, 'pre') && 'prerelease-latest' || 'latest' }}
29
+ DOCKER_FILE : " Dockerfile.${{ matrix.image_type }}"
30
+ IMAGE_SUFFIX : ${{ !contains(matrix.image_type, 'alpine') && '-${{ matrix.image_type }}' || '' }}
26
31
steps :
27
32
- uses : actions/checkout@v3
33
+
28
34
- uses : actions/setup-go@v3
29
35
with :
30
36
go-version : 1.19
@@ -53,13 +59,14 @@ jobs:
53
59
cache-from : type=gha
54
60
cache-to : type=gha,mode=max
55
61
context : .
62
+ file : ${{ env.DOCKER_FILE }}
56
63
platforms : linux/arm64/v8,linux/amd64,linux/arm/v7
57
64
push : ${{ github.event_name != 'pull_request' }}
58
65
tags : |
59
- ghcr.io/${{ github.repository_owner }}/atlantis:dev
66
+ ghcr.io/${{ github.repository_owner }}/atlantis:dev${{ env.IMAGE_SUFFIX }}
60
67
61
68
# Publish release to container registry
62
- - name : populate release version
69
+ - name : Populate release version
63
70
if : |
64
71
contains(fromJson('["push", "pull_request"]'), github.event_name) &&
65
72
startsWith(github.ref, 'refs/tags/')
74
81
cache-from : type=gha
75
82
cache-to : type=gha,mode=max
76
83
context : .
84
+ file : ${{ env.DOCKER_FILE }}
77
85
platforms : linux/arm64/v8,linux/amd64,linux/arm/v7
78
86
push : ${{ github.event_name != 'pull_request' }}
79
87
tags : |
80
- ghcr.io/${{ github.repository_owner }}/atlantis:${{ env.RELEASE_VERSION }}
81
- ghcr.io/${{ github.repository_owner }}/atlantis:${{ env.RELEASE_TAG }}
88
+ ghcr.io/${{ github.repository_owner }}/atlantis:${{ env.RELEASE_VERSION }}${{ env.IMAGE_SUFFIX }}
89
+ ghcr.io/${{ github.repository_owner }}/atlantis:${{ env.RELEASE_TAG }}${{ env.IMAGE_SUFFIX }}
0 commit comments