1212 permissions :
1313 contents : write
1414 packages : write
15+ outputs :
16+ release_tag : ${{ steps.tag_commit.outputs.release_tag }}
1517
1618 runs-on : ubuntu-latest
1719
@@ -93,29 +95,37 @@ jobs:
9395 asset_name : switchbot-mcp-server.jar
9496 asset_content_type : application/java-archive
9597
98+ push-to-ghcr :
99+ permissions :
100+ contents : read
101+ packages : write
102+ needs :
103+ - release
104+ runs-on : ubuntu-latest
105+ steps :
106+ - name : Checkout
107+ uses : actions/checkout@v6
108+ with :
109+ ref : ${{ needs.release.outputs.release_tag }}
110+
96111 - name : Log in to the GitHub Container Registry
97112 uses : docker/login-action@v3
98113 with :
99114 registry : ghcr.io
100115 username : ${{ github.actor }}
101116 password : ${{ secrets.GITHUB_TOKEN }}
102117
103- - name : Log in to Quay.io
104- uses : docker/login-action@v3
105- with :
106- registry : quay.io
107- username : ${{ secrets.QUAY_BOT_USERNAME }}
108- password : ${{ secrets.QUAY_BOT_TOKEN }}
118+ - name : Set up Docker Buildx
119+ uses : docker/setup-buildx-action@v3
109120
110121 - name : Extract metadata (tags, labels) for Docker
111122 id : meta
112123 uses : docker/metadata-action@v5
113124 with :
114125 images : |
115126 ghcr.io/${{ github.repository }}
116- quay.io/sharplab/switchbot-mcp-server
117127 tags : |
118- type=raw,value=${{ steps.tag_commit .outputs.release_tag }}
128+ type=raw,value=${{ needs.release .outputs.release_tag }}
119129
120130 - name : Build and push Docker image
121131 uses : docker/build-push-action@v6
@@ -127,3 +137,43 @@ jobs:
127137 labels : ${{ steps.meta.outputs.labels }}
128138 provenance : true
129139 sbom : true
140+
141+ push-to-quay :
142+ permissions :
143+ contents : read
144+ packages : write
145+ needs :
146+ - release
147+ runs-on : ubuntu-latest
148+ env :
149+ REGISTRY : quay.io
150+ IMAGE : sharplab/switchbot-mcp-server
151+ steps :
152+ - name : Checkout
153+ uses : actions/checkout@v6
154+ with :
155+ ref : ${{ needs.release.outputs.release_tag }}
156+
157+ - name : Log in to Quay.io
158+ uses : redhat-actions/podman-login@v1
159+ with :
160+ registry : ${{ env.REGISTRY }}
161+ username : ${{ secrets.QUAY_BOT_USERNAME }}
162+ password : ${{ secrets.QUAY_BOT_TOKEN }}
163+
164+ - name : Build image (buildah)
165+ id : build_image
166+ uses : redhat-actions/buildah-build@v2
167+ with :
168+ image : ${{ env.IMAGE }}
169+ tags : ${{ needs.release.outputs.release_tag }}
170+ containerfiles : |
171+ ./switchbot-mcp-server/src/main/docker/Dockerfile
172+ context : .
173+
174+ - name : Push to Quay
175+ uses : redhat-actions/push-to-registry@v2
176+ with :
177+ image : ${{ steps.build_image.outputs.image }}
178+ tags : ${{ steps.build_image.outputs.tags }}
179+ registry : ${{ env.REGISTRY }}
0 commit comments