-
Notifications
You must be signed in to change notification settings - Fork 220
45 lines (43 loc) · 1.46 KB
/
docker-tt-smi.yml
File metadata and controls
45 lines (43 loc) · 1.46 KB
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
45
name: Build TT SMI Docker image
on:
workflow_dispatch:
inputs:
image_name:
description: "Docker image name"
required: true
default: "dstackai/tt-smi"
tt_smi_version:
description: "TT SMI version"
required: true
default: "3.0.25"
jobs:
build-tt-smi:
defaults:
run:
working-directory: docker/tt-smi
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and upload to DockerHub
run: |
IMAGE_NAME=${{ inputs.image_name }}
docker buildx build . \
--load \
--provenance=false \
--platform linux/amd64 \
--build-arg IMAGE_NAME=${IMAGE_NAME} \
--build-arg TT_SMI_VERSION=${{ inputs.tt_smi_version }} \
--build-arg BUILD_DATE=$(date --utc --iso-8601=seconds)Z \
--tag ${IMAGE_NAME}:latest
VERSION=$(docker inspect --format '{{ index .Config.Labels "org.opencontainers.image.version" }}' ${IMAGE_NAME})
docker tag ${IMAGE_NAME}:latest ${IMAGE_NAME}:${VERSION}
docker push ${IMAGE_NAME}:${VERSION}
docker push ${IMAGE_NAME}:latest