1
1
---
2
2
3
- name : CI
4
-
5
3
on : # yamllint disable-line rule:truthy
6
4
push :
7
5
branches :
@@ -18,31 +16,40 @@ on: # yamllint disable-line rule:truthy
18
16
# Every Tuesday at 03:10
19
17
- cron : ' 10 3 * * 2'
20
18
19
+ name : 🔍 Continuous integration
20
+
21
21
jobs :
22
22
build :
23
- name : Build
24
23
runs-on : ubuntu-latest
25
24
strategy :
26
25
fail-fast : false
27
26
matrix :
28
27
rabbitmq_version : ['alpine', 'management-alpine']
29
28
steps :
30
- -
uses :
e1himself/[email protected]
29
+ - name : 📦 Install goss
30
+
31
+
32
+ - name : 📦 Check out the codebase
33
+ uses : actions/checkout@v3
34
+ with :
35
+ fetch-depth : 0
31
36
32
- - name : Checkout
33
-
37
+ - name : 🤖 Generate dist files
38
+ run : make generate
34
39
35
- - name : Set Environment Variables
40
+ - name : 🌎 Set environment variables
36
41
env :
37
42
IMAGE_NAMESPACE : wayofdev/rabbitmq
38
43
TEMPLATE : ${{ matrix.rabbitmq_version }}
39
44
run : |
40
- export RELEASE_VERSION=${GITHUB_REF#refs/*/}
41
- echo "IMAGE_NAMESPACE=${IMAGE_NAMESPACE}" >> $GITHUB_ENV
42
- echo "TEMPLATE=${TEMPLATE}" >> $GITHUB_ENV
43
- echo "VERSION=${RELEASE_VERSION:1}" >> $GITHUB_ENV
45
+ export RELEASE_VERSION="${GITHUB_REF#refs/*/}" \
46
+ && { \
47
+ echo "IMAGE_NAMESPACE=${IMAGE_NAMESPACE}"; \
48
+ echo "TEMPLATE=${TEMPLATE}"; \
49
+ echo "VERSION=${RELEASE_VERSION:1}"; \
50
+ } >> "$GITHUB_ENV"
44
51
45
- - name : Docker Meta
52
+ - name : 🐳 Define docker meta
46
53
id : meta
47
54
uses : docker/metadata-action@v4
48
55
with :
@@ -56,46 +63,50 @@ jobs:
56
63
latest=false
57
64
prefix=${{ matrix.rabbitmq_version }}-
58
65
59
- - name : Login to DockerHub
66
+ - name : 🔑 Login to docker-hub
60
67
if : github.event_name != 'pull_request'
61
68
uses : docker/login-action@v2
62
69
with :
63
70
username : ${{ secrets.DOCKER_USERNAME }}
64
71
password : ${{ secrets.DOCKER_TOKEN }}
65
72
66
73
# ## For Cross Platform OSX builds uncomment these lines
67
- - name : Set up QEMU
74
+ - name : 🖥️ Set up QEMU
68
75
69
76
with :
70
77
platforms : arm64
71
78
72
- - name : Set up Docker Buildx
79
+ - name : 🚀 Set up Docker BuildX
73
80
uses : docker/setup-buildx-action@v2
74
81
with :
75
82
install : true
76
83
77
- - name : Build and Export to Docker
78
- uses : docker/build-push-action@v3
84
+ - name : 🏷️ Set tag for docker release image
85
+ if : success() && startsWith(github.ref, 'refs/tags/')
86
+ run : |
87
+ echo "IMAGE_TAG=${{ env.IMAGE_NAMESPACE }}:${{ env.TEMPLATE }}-${{ env.VERSION }}" >> "$GITHUB_ENV"
88
+
89
+ - name : 🏷️ Set tag for docker master image
90
+ if : success() && ! startsWith(github.ref, 'refs/tags/')
91
+ run : |
92
+ echo "IMAGE_TAG=${{ env.IMAGE_NAMESPACE }}:${{ env.TEMPLATE }}-latest" >> "$GITHUB_ENV"
93
+
94
+ - name : 🛠️ Build and export to docker
95
+ uses : docker/build-push-action@v4
79
96
with :
80
97
context : ./dist/${{ env.TEMPLATE }}
81
98
load : true
82
99
tags : ${{ steps.meta.outputs.tags }}
83
- cache-from : type=registry,ref=${{ env.IMAGE_TAG }}
100
+ cache-from : type=registry,ref=${{ env.IMAGE_NAMESPACE }}:${{ env.TEMPLATE }}-latest
84
101
cache-to : type=inline
85
102
labels : ${{ steps.meta.outputs.labels }}
86
103
87
- - name : Test Docker Release Image
88
- if : success() && startsWith(github.ref, 'refs/tags/')
89
- run : |
90
- IMAGE_TAG=${{ env.IMAGE_NAMESPACE }}:${{ env.TEMPLATE }}-${{ env.VERSION }} make test
91
-
92
- - name : Test Docker Master Image
93
- if : success() && ! startsWith(github.ref, 'refs/tags/')
104
+ - name : 🧪 Test docker image
94
105
run : |
95
- IMAGE_TAG=${{ env.IMAGE_NAMESPACE }}:${{ env.TEMPLATE }}-latest make test
106
+ export IMAGE_TAG=${{ env.IMAGE_TAG }}; make test
96
107
97
- - name : Push Docker Image
98
- uses : docker/build-push-action@v3
108
+ - name : 📤 Push docker image
109
+ uses : docker/build-push-action@v4
99
110
with :
100
111
context : ./dist/${{ env.TEMPLATE }}
101
112
# ## For Cross Platform OSX builds uncomment these lines
0 commit comments