File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 21
21
username : ${{ secrets.DOCKER_USERNAME }}
22
22
password : ${{ secrets.DOCKER_ACCESS_TOKEN }}
23
23
24
+ - name : Generate tag name
25
+ id : prep
26
+ run : |
27
+ DOCKER_IMAGE=johanbook/file-domain-server
28
+ VERSION=latest
29
+ SHORTREF=${GITHUB_SHA::8}
30
+
31
+ # If this is git tag, use the tag name as a docker tag
32
+ if [[ $GITHUB_REF == refs/tags/* ]]; then
33
+ VERSION=${GITHUB_REF#refs/tags/v}
34
+ fi
35
+ TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"
36
+
37
+ # If the VERSION looks like a version number, assume that
38
+ # this is the most recent version of the image and also
39
+ # tag it 'latest'.
40
+ if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
41
+ TAGS="$TAGS,${DOCKER_IMAGE}:latest"
42
+ fi
43
+
44
+ # Set output parameters.
45
+ echo ::set-output name=tags::${TAGS}
46
+ echo ::set-output name=docker_image::${DOCKER_IMAGE}
47
+
24
48
- name : Build Docker images
25
49
uses : docker/build-push-action@v2
26
50
with :
29
53
file : ./Dockerfile
30
54
platforms : linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le
31
55
push : true
32
- tags : johanbook/file-domain-server: ${{GITHUB_REF#refs/ tags/v }}
56
+ tags : ${{ steps.prep.outputs. tags }}
You can’t perform that action at this time.
0 commit comments