name: Publish Docker image on: push jobs: push_to_registry: name: Push Docker image to Docker Hub runs-on: ubuntu-latest steps: - name: Check out the repo uses: actions/checkout@v4 - name: Run read-yaml action id: yaml-data uses: jbutcher5/read-yaml@1.6 with: file: "./matter-bridge/config.yml" key-path: '["version"]' - name: Display read-yaml output run: echo "${{ steps.yaml-data.outputs.data }}" - name: Log in to the Container registry uses: docker/login-action@v3.0.0 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GHCR }} - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 with: images: ghcr.io/${{ github.repository }} tags: | type=raw,value=${{ steps.yaml-data.outpus.data }} - name: Build and push Docker image uses: docker/build-push-action@v5.1.0 with: context: ./matter-bridge file: ./matter-bridge/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}