v2.13.1 #52
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push-Images | |
on: | |
release: | |
types: | |
- published | |
- edited | |
permissions: | |
contents: read | |
jobs: | |
push-images: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
permissions: | |
packages: write # to push to ghcr.io | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-python | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Gather Docker Metadata for Tracking | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
ghcr.io/mlflow/mlflow | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=ref,event=tag | |
- name: Build and Push Base Image | |
uses: docker/build-push-action@v3 | |
with: | |
context: docker | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
VERSION=${{ steps.meta.outputs.version }} | |
- name: Gather Docker Metadata for Model Server | |
id: modelmeta | |
uses: docker/metadata-action@v4 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
ghcr.io/mlflow/model-server | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=ref,event=tag | |
- name: Build Model Server Image | |
run: | | |
pip install . | |
mlflow models build-docker -n model-server:latest --mlflow-home `pwd` | |
- name: Push Model Server Image | |
run: | | |
set -x | |
tags=$(echo -n "${{ steps.modelmeta.outputs.tags }}" | tr '\n' ' ') | |
for tag in $tags; do | |
docker tag model-server:latest $tag | |
docker push $tag | |
done |