#patch: support tpu compatible docker image #58
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: deploy | |
on: | |
push: | |
branches: | |
- main | |
env: | |
PLATFORMS: linux/arm64,linux/amd64 | |
jobs: | |
semver: | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.tagging.outputs.new_tag }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' | |
- name: Bump version and push tag | |
uses: anothrNick/[email protected] | |
id: tagging | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
RELEASE_BRANCHES: main | |
DEFAULT_BUMP: minor | |
publish-docker-image: | |
runs-on: ubuntu-latest | |
needs: semver | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Build | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push CPU | |
id: docker_build_push | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: ${{ github.repository }}:latest,${{ github.repository }}:${{ needs.semver.outputs.tag }} | |
platforms: ${{ env.PLATFORMS }} | |
publish-docker-image-tpu: | |
runs-on: ubuntu-latest | |
needs: semver | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Build | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Delete huge unnecessary tools folder | |
run: rm -rf /opt/hostedtoolcache | |
- name: Build and push arm64 TPU | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
file: ./Dockerfile.tpu | |
build-args: | | |
ULTRALYTICS_TAG=latest-arm64 | |
tags: ${{ github.repository }}:latest-arm64-tpu,${{ github.repository }}:${{ needs.semver.outputs.tag }}-arm64-tpu | |
platforms: linux/arm64 | |
# - name: Build and push amd64 TPU | |
# uses: docker/build-push-action@v4 | |
# with: | |
# push: true | |
# file: ./Dockerfile.tpu | |
# build-args: | | |
# ULTRALYTICS_TAG=latest-cpu | |
# tags: ${{ github.repository }}:latest-amd64-tpu,${{ github.repository }}:${{ needs.semver.outputs.tag }}-amd64-tpu | |
# platforms: linux/amd64 |