Skip to content

Build Docker for packaging #1

Build Docker for packaging

Build Docker for packaging #1

# GH actions.
name: Build Docker for packaging
on:
workflow_dispatch:
jobs:
Build:
strategy:
matrix:
platform:
- cpu
- rocm56
- rocm57
- cu117
- cu118
- cu121
- cu122
runs-on: ubuntu-latest
steps:
- name: Reclaim disk space
run: |
df -h
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/local/.ghcup
df -h
- uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.MLCAI_DOCKERHUB_USERNAME }}
password: ${{ secrets.MLCAI_DOCKERHUB_TOKEN }}
- name: Build Docker image
run: |
set -eux
cd docker
docker build -t package-${{ matrix.platform }} -f Dockerfile.package-${{ matrix.platform }} .
- name: Upload to Docker Hub
if: ${{ github.ref == 'refs/heads/main' }}
run: |
set -eux
NEW_TAG=$(git log -1 --format='%h')
docker tag package-${{ matrix.platform }} mlcaidev/package-${{ matrix.platform }}:$NEW_TAG
docker push mlcaidev/package-${{ matrix.platform }}:$NEW_TAG