@@ -144,3 +144,53 @@ jobs:
144144 uses : pypa/gh-action-pypi-publish@release/v1
145145 with :
146146 password : ${{ secrets.PYPI_API_TOKEN }}
147+
148+ publish_image :
149+ runs-on : ubuntu-latest
150+ needs : [test_and_build]
151+ if : github.event.repository.fork == false && startsWith(github.ref, 'refs/tags')
152+ steps :
153+ - name : Checkout
154+ uses : actions/checkout@v3
155+
156+ - name : Download build artifact
157+ uses : actions/download-artifact@v3
158+ with :
159+ name : wheel2deb_linux_amd64
160+
161+ - name : Set execute permission
162+ run : chmod +x wheel2deb_linux_amd64
163+
164+ - name : Login to GitHub Container Registry
165+ uses : docker/login-action@v3
166+ with :
167+ registry : ghcr.io
168+ username : ${{ github.actor }}
169+ password : ${{ secrets.GITHUB_TOKEN }}
170+
171+ - name : Set docker image tags and labels
172+ id : meta
173+ uses : docker/metadata-action@v5
174+ with :
175+ images : ghcr.io/upciti/wheel2deb
176+ tags : |
177+ type=semver,pattern={{version}}
178+ type=semver,pattern={{major}}.{{minor}}
179+ type=semver,pattern={{major}}
180+ type=ref,event=branch
181+
182+ - name : Build Docker image
183+ uses : docker/build-push-action@v6
184+ with :
185+ context : .
186+ build-args : |
187+ WHEEL2DEB_PATH=wheel2deb_linux_amd64
188+ tags : ${{ steps.meta.outputs.tags }}
189+ labels : ${{ steps.meta.outputs.labels }}
190+
191+ - name : Check Docker image
192+ run : docker run --rm -i ghcr.io/${{ github.event.repository.full_name }}:latest --help
193+
194+ - name : Publish Docker image
195+ run : |
196+ docker push --all-tags ghcr.io/${{ github.event.repository.full_name }}
0 commit comments