Build Docker images #113
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: Build Docker images | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: '0 5 * * 3' | |
jobs: | |
Build: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- cpu | |
- cu102 | |
# - cu110 | |
- cu111 | |
- cu113 | |
- cu116 | |
- cu117 | |
- cu118 | |
- cu121 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.TLCPACK_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.TLCPACK_DOCKERHUB_TOKEN }} | |
- name: Build Docker image | |
run: | | |
set -eux | |
cd docker | |
bash build_image.sh ${{ 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 tlcpack/package-${{ matrix.platform }}:staging tlcpack/package-${{ matrix.platform }}:$NEW_TAG | |
docker push tlcpack/package-${{ matrix.platform }}:$NEW_TAG |