From 2b90c7f8a458a281136a684148c77ebe9251b49d Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 16 Jun 2021 19:14:15 +0300 Subject: workflows/ci: push versioned images to Docker Hub --- .github/workflows/ci.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73aa411..2867eda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,19 @@ jobs: name: 'Publish: Docker Hub' if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')) steps: + # https://github.com/docker/metadata-action#semver + - id: meta + name: Docker Hub metadata + uses: docker/metadata-action@v3 + with: + images: '${{ secrets.DOCKERHUB_USERNAME }}/cgitize' + flavor: | + latest=auto + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx @@ -55,7 +68,8 @@ jobs: with: platforms: linux/amd64,linux/armhf push: true - tags: '${{ secrets.DOCKERHUB_USERNAME }}/cgitize:latest' + tags: '${{ steps.meta.outputs.tags }}' + labels: '${{ steps.meta.outputs.labels }}' publish_pypi: needs: [test_local, test_docker] -- cgit v1.2.3