-
Notifications
You must be signed in to change notification settings - Fork 14
44 lines (41 loc) · 1.17 KB
/
build_docker_package.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# GH actions.
name: Build Docker for packaging
on:
workflow_dispatch:
jobs:
Build:
strategy:
matrix:
platform:
- cpu
- rocm61
- rocm62
- cu122
- cu123
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