diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3665f55..462f933 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -39,3 +39,33 @@ jobs: tag: ${{ github.ref }} overwrite: true + dockerhub: + name: Publish Docker image + runs-on: ubuntu-latest + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: spotify/xcmetrics:${{ steps.get_version.outputs.VERSION }} + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }}