diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 29e58506386..521a4f654e4 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -22,14 +22,17 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Get branch or tag name - id: ref-name - run: echo ::set-output name=ref::${GITHUB_REF#refs/*/} + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }}-server - name: Build and push uses: docker/build-push-action@v4 with: context: . file: ./misc/server/Dockerfile - push: true - tags: ghcr.io/${{ github.repository }}-server:${{ steps.ref-name.outputs.ref }} + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}