diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 5cd1c1e..37d7e9e 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -4,6 +4,8 @@ on: push: branches: - 'main' + tags: + - 'v*' pull_request: jobs: @@ -16,8 +18,15 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: ghcr.io/${{ github.repository }} + - name: Login to Github Packages uses: docker/login-action@v1 + if: github.event_name != 'pull_request' with: registry: ghcr.io username: ${{ github.actor }} @@ -27,5 +36,7 @@ jobs: id: docker_build uses: docker/build-push-action@v2 with: - push: ${{ github.ref == 'refs/heads/main' }} - tags: ghcr.io/chaoswest-tv/durchsage:latest \ No newline at end of file + context: . + push: ${{ github.event_name != 'pull_request'}} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file