diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 21d23d0c1e..84ebcf5d33 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,14 +13,14 @@ jobs: - uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 - name: Login to dockerhub - if: github.ref == 'refs/heads/master' + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Login to GitHub - if: github.ref == 'refs/heads/master' + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 with: registry: ghcr.io @@ -40,9 +40,10 @@ jobs: type=edge,branch=$repo.default_branch - name: build+push + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 with: platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 - push: ${{ github.ref == 'refs/heads/master' }} + push: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }}