-
Notifications
You must be signed in to change notification settings - Fork 4
73 lines (62 loc) · 2.15 KB
/
docker.yml
File metadata and controls
73 lines (62 loc) · 2.15 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Build and Push Docker Images
# CI builds pull all model checkpoints (~10 GB) from Docker Hub automatically via:
# COPY --from=diffuseproject/sampleworks-checkpoints:latest /checkpoints/ /checkpoints/
# No checkpoint files are needed on the CI runner. The checkpoints base image is
# pre-built and pushed from the GPU server. See Dockerfile comments for details.
on:
push:
branches: [main]
tags:
- 'v*.*.*'
workflow_dispatch:
env:
DOCKERHUB_ORG: diffuseproject
IMAGE_NAME: sampleworks
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Free disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# The Dockerfile uses COPY --from=diffuseproject/sampleworks-checkpoints:latest
# which Docker automatically pulls from Docker Hub during the build.
# No checkpoint files are needed in the CI build context.
- name: Docker metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.DOCKERHUB_ORG }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=sha,prefix=
type=semver,pattern={{version}}
type=semver,pattern=v{{version}}
- name: Build and push Docker image
id: build-push
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
- name: Image digest
run: echo "Image pushed with digest ${{ steps.build-push.outputs.digest }}"