1
- name : Release
1
+ name : Deploy
2
2
3
3
on :
4
- workflow_run :
5
- workflows :
6
- - " Build & Test"
7
- types :
8
- - completed
9
4
push :
10
5
tags :
11
6
- ' v*.*.*'
14
9
DOCKERHUB_REPO : caik/go-mock-server
15
10
16
11
jobs :
17
- release :
12
+ build :
13
+ uses : ./.github/workflows/build.yml
14
+
15
+ github-release :
16
+ name : Create Github Release
17
+ needs : build
18
18
runs-on : ubuntu-latest
19
19
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
20
20
steps :
40
40
GH_RELEASER : ${{ secrets.GH_RELEASER }}
41
41
42
42
docker-build :
43
- needs : release
44
- name : Deploy to DockerHub
43
+ name : Build Docker Image
44
+ needs : build
45
45
runs-on : ubuntu-latest
46
46
strategy :
47
47
fail-fast : false
57
57
platform=${{ matrix.platform }}
58
58
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
59
59
60
- - name : Docker meta
60
+ - name : Docker Meta
61
61
id : meta
62
62
uses : docker/metadata-action@v5
63
63
with :
76
76
with :
77
77
platforms : linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
78
78
79
- - name : Build and push by digest
79
+ - name : Build and Push by Digest
80
80
id : build
81
81
uses : docker/build-push-action@v6
82
82
with :
@@ -85,26 +85,27 @@ jobs:
85
85
outputs : type=image,"name=${{ env.DOCKERHUB_REPO }}",push-by-digest=true,name-canonical=true,push=true
86
86
build-args : VERSION=${GITHUB_REF#refs/*/}
87
87
88
- - name : Export digest
88
+ - name : Export Digest
89
89
run : |
90
90
mkdir -p /tmp/digests
91
91
digest="${{ steps.build.outputs.digest }}"
92
92
touch "/tmp/digests/${digest#sha256:}"
93
93
94
- - name : Upload digest
94
+ - name : Upload Digest
95
95
uses : actions/upload-artifact@v4
96
96
with :
97
97
name : digests-${{ env.PLATFORM_PAIR }}
98
98
path : /tmp/digests/*
99
99
if-no-files-found : error
100
100
retention-days : 1
101
101
102
- merge :
102
+ docker-merge :
103
+ name : Merge Docker Multi-Arch Images
103
104
runs-on : ubuntu-latest
104
105
needs :
105
106
- docker-build
106
107
steps :
107
- - name : Download digests
108
+ - name : Download Digests
108
109
uses : actions/download-artifact@v4
109
110
with :
110
111
path : /tmp/digests
@@ -120,7 +121,7 @@ jobs:
120
121
- name : Set up Docker Buildx
121
122
uses : docker/setup-buildx-action@v3
122
123
123
- - name : Docker meta
124
+ - name : Docker Meta
124
125
id : meta
125
126
uses : docker/metadata-action@v5
126
127
with :
@@ -131,12 +132,12 @@ jobs:
131
132
type=semver,pattern={{version}}
132
133
type=semver,pattern={{major}}.{{minor}}
133
134
134
- - name : Create manifest list and push
135
+ - name : Create Manifest List and Push
135
136
working-directory : /tmp/digests
136
137
run : |
137
138
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
138
139
$(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *)
139
140
140
- - name : Inspect image
141
+ - name : Inspect Image
141
142
run : |
142
143
docker buildx imagetools inspect ${{ env.DOCKERHUB_REPO }}:${{ steps.meta.outputs.version }}
0 commit comments