@@ -15,29 +15,22 @@ jobs:
1515 - name : Checkout
1616 uses : actions/checkout@v2
1717
18- - name : Prepare
19- id : prep
20- run : |
21- DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
22- VERSION=latest
23- SHORTREF=${GITHUB_SHA::8}
24-
25- # If this is git tag, use the tag name as a docker tag
26- if [[ $GITHUB_REF == refs/tags/* ]]; then
27- VERSION=${GITHUB_REF#refs/tags/v}
28- fi
29- TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"
30-
31- # If the VERSION looks like a version number, assume that
32- # this is the most recent version of the image and also
33- # tag it 'latest'.
34- if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
35- TAGS="$TAGS,${DOCKER_IMAGE}:latest"
36- fi
37-
38- # Set output parameters.
39- echo ::set-output name=tags::${TAGS}
40- echo ::set-output name=docker_image::${DOCKER_IMAGE}
18+ - name : Docker meta
19+ id : meta
20+ uses : docker/metadata-action@v3
21+ with :
22+ images : |
23+ cagataygurturk/docker-ssh-tunnel
24+ flavor : |
25+ latest=auto
26+ tags : |
27+ type=schedule
28+ type=ref,event=branch
29+ type=ref,event=pr
30+ type=semver,pattern={{version}}
31+ type=semver,pattern={{major}}.{{minor}}
32+ type=semver,pattern={{major}}
33+ type=sha
4134
4235 - name : Set up QEMU
4336 uses : docker/setup-qemu-action@master
6356 file : ./Dockerfile
6457 platforms : linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7,linux/arm/v6
6558 push : true
66- tags : ${{ steps.prep .outputs.tags }}
59+ tags : ${{ steps.meta .outputs.tags }}
0 commit comments