Build Docker for CI #6
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
# GH actions. | |
name: Build Docker for CI | |
on: | |
workflow_dispatch: | |
jobs: | |
Build: | |
strategy: | |
matrix: | |
platform: | |
- cpu | |
- cu121 | |
- rocm57 | |
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 | |
docker image prune --all -f | |
docker system prune -f | |
docker images -a | |
docker ps -a | |
df -h | |
- uses: actions/checkout@v3 | |
- name: Show tags | |
run: | | |
TAG=$(git log -1 --format='%h') | |
echo "TAG=$TAG" | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.MLCAI_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.MLCAI_DOCKERHUB_TOKEN }} | |
- name: Build | |
run: | | |
cd docker-ci && docker build --rm -t ci-${{ matrix.platform }} -f Dockerfile.${{ matrix.platform }} . | |
- name: Upload | |
run: | | |
bash ./docker-ci/scripts/docker-push.sh ${{ matrix.platform }} |