diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7fbc577..84a7bc4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -127,11 +127,48 @@ jobs: - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + publish-to-ghcr: + name: Publish Docker Image to Container Registry + needs: check_version + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Check out the repo + uses: actions/checkout@v4 + - name: Docker meta + id: docker_meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/miaucl/docker2mqtt + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: linux/amd64,linux/arm64 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/amd64,linux/arm64 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: miaucl + password: ${{ secrets.GITHUB_TOKEN }} + - name: Push to GitHub Packages + uses: docker/build-push-action@v6 + with: + file: Dockerfile + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + github-release: name: >- Create GitHub release and attach binaries needs: - publish-to-pypi + - publish-to-ghcr runs-on: ubuntu-latest permissions: