@@ -108,133 +108,10 @@ jobs:
108108
109109 publish_docker :
110110 name : 🐋 Publish Docker images
111- runs-on : ubuntu-latest
112- needs : [publish_release]
113- # Don't error while this is in BETA
114- continue-on-error : true
111+ needs : publish_release
112+ uses : ./.github/workflows/publish-docker.yml
113+ with :
114+ marimo_version : ${{ needs.publish_release.outputs.marimo_version }}
115115 permissions :
116116 contents : read
117117 packages : write
118-
119- steps :
120- - name : ⬇️ Checkout repo
121- uses : actions/checkout@v4
122-
123- - name : ⏳ Wait for PyPI package availability
124- run : |
125- VERSION="${{ needs.publish_release.outputs.marimo_version }}"
126- echo "Waiting for marimo version $VERSION to be available on PyPI..."
127-
128- MAX_ATTEMPTS=30
129- ATTEMPT=0
130- SLEEP_TIME=10
131-
132- while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
133- ATTEMPT=$((ATTEMPT + 1))
134- echo "Attempt $ATTEMPT/$MAX_ATTEMPTS: Checking PyPI for version $VERSION..."
135-
136- # Check if the version exists on PyPI
137- HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/marimo/$VERSION/json")
138-
139- if [ "$HTTP_CODE" = "200" ]; then
140- echo "✅ Version $VERSION is available on PyPI!"
141- exit 0
142- else
143- echo "Version $VERSION not yet available (HTTP $HTTP_CODE). Waiting ${SLEEP_TIME}s..."
144- sleep $SLEEP_TIME
145- fi
146- done
147-
148- echo "❌ Timed out waiting for version $VERSION on PyPI after $((MAX_ATTEMPTS * SLEEP_TIME)) seconds"
149- exit 1
150-
151- - name : 🐋 Log in to the Container registry
152- uses : docker/login-action@v3
153- with :
154- registry : ${{ env.REGISTRY }}
155- username : ${{ github.actor }}
156- password : ${{ secrets.GITHUB_TOKEN }}
157-
158- - name : 🐋 Extract metadata (tags, labels) for Docker
159- id : meta
160- uses : docker/metadata-action@v5
161- with :
162- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
163-
164- - name : 🐋 Set up Docker Buildx
165- uses : docker/setup-buildx-action@v3
166-
167- - name : 🧪 Build docker image for testing
168- uses : docker/build-push-action@v6
169- with :
170- context : .
171- file : ./docker/Dockerfile
172- # Don't push test image
173- push : false
174- load : true
175- tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
176- target : slim
177- build-args : |
178- marimo_version=${{ needs.publish_release.outputs.marimo_version }}
179- labels : ${{ steps.meta.outputs.labels }}
180- cache-from : type=gha
181- cache-to : type=gha,mode=max
182-
183- - name : 🧪 Test docker build
184- run : |
185- docker run -d -e PORT=9090 -p 9090:9090 --name test_container ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
186- sleep 2
187- curl -f http://localhost:9090/health || (docker logs test_container && exit 1)
188- docker stop test_container
189- docker rm test_container
190-
191- - name : 📦 Build and push Docker images (slim)
192- uses : docker/build-push-action@v6
193- with :
194- context : .
195- file : ./docker/Dockerfile
196- push : true
197- tags : |
198- ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.publish_release.outputs.marimo_version }}
199- ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
200- target : slim
201- platforms : linux/amd64,linux/arm64
202- build-args : |
203- marimo_version=${{ needs.publish_release.outputs.marimo_version }}
204- labels : ${{ steps.meta.outputs.labels }}
205- cache-from : type=gha
206- cache-to : type=gha,mode=max
207-
208- - name : 📦 Build and push Docker images (data)
209- uses : docker/build-push-action@v6
210- with :
211- context : .
212- file : ./docker/Dockerfile
213- push : true
214- tags : |
215- ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.publish_release.outputs.marimo_version }}-data
216- ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-data
217- target : data
218- platforms : linux/amd64,linux/arm64
219- build-args : |
220- marimo_version=${{ needs.publish_release.outputs.marimo_version }}
221- labels : ${{ steps.meta.outputs.labels }}
222- cache-from : type=gha
223- cache-to : type=gha,mode=max
224-
225- - name : 📦 Build and push Docker images (sql)
226- uses : docker/build-push-action@v6
227- with :
228- context : .
229- file : ./docker/Dockerfile
230- push : true
231- tags : |
232- ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.publish_release.outputs.marimo_version }}-sql
233- ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-sql
234- target : sql
235- platforms : linux/amd64,linux/arm64
236- build-args : |
237- marimo_version=${{ needs.publish_release.outputs.marimo_version }}
238- labels : ${{ steps.meta.outputs.labels }}
239- cache-from : type=gha
240- cache-to : type=gha,mode=max
0 commit comments