Skip to content

Commit 6807908

Browse files
ci: add caching
1 parent b26fd46 commit 6807908

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

.github/workflows/build.yaml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -78,30 +78,29 @@
7878
install: true
7979
- name: Inject slug/short variables
8080
uses: rlespinasse/github-slug-action@v4.4.1
81-
# - name: Tailscale
82-
# uses: tailscale/github-action@7bd8039bf25c23c4ab1b8d6e2cc2da2280601966
83-
# with:
84-
# authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
81+
- name: Tailscale
82+
uses: tailscale/github-action@7bd8039bf25c23c4ab1b8d6e2cc2da2280601966
83+
with:
84+
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
8585
- name: Login to GitHub Container Registry
86-
# if: github.event_name != 'pull_request'
86+
if: github.event_name != 'pull_request'
8787
uses: docker/login-action@v2
8888
with:
8989
registry: ghcr.io
9090
username: ${{ github.actor }}
9191
password: ${{ secrets.GITHUB_TOKEN }}
92-
# - name: Login to internal Container Registry
93-
# uses: docker/login-action@v2.1.0
94-
# with:
95-
# username: ${{ secrets.TAILSCALE_DOCKER_USERNAME }}
96-
# password: ${{ secrets.TAILSCALE_DOCKER_PASSWORD }}
97-
# registry: registry.internal.huggingface.tech
92+
- name: Login to internal Container Registry
93+
uses: docker/login-action@v2.1.0
94+
with:
95+
username: ${{ secrets.TAILSCALE_DOCKER_USERNAME }}
96+
password: ${{ secrets.TAILSCALE_DOCKER_PASSWORD }}
97+
registry: registry.internal.huggingface.tech
9898
- name: Extract metadata (tags, labels) for Docker
9999
id: meta-75
100100
uses: docker/metadata-action@v4.3.0
101101
with:
102-
flavor: |
103-
latest=auto
104102
images: |
103+
registry.internal.huggingface.tech/text-embeddings-inference
105104
ghcr.io/huggingface/text-embeddings-inference
106105
tags: |
107106
type=semver,pattern=turing-{{version}}
@@ -112,9 +111,8 @@
112111
id: meta-80
113112
uses: docker/metadata-action@v4.3.0
114113
with:
115-
flavor: |
116-
latest=auto
117114
images: |
115+
registry.internal.huggingface.tech/text-embeddings-inference
118116
ghcr.io/huggingface/text-embeddings-inference
119117
tags: |
120118
type=semver,pattern={{version}}
@@ -125,9 +123,8 @@
125123
id: meta-86
126124
uses: docker/metadata-action@v4.3.0
127125
with:
128-
flavor: |
129-
latest=auto
130126
images: |
127+
registry.internal.huggingface.tech/text-embeddings-inference
131128
ghcr.io/huggingface/text-embeddings-inference
132129
tags: |
133130
type=semver,pattern=86-{{version}}
@@ -138,9 +135,8 @@
138135
id: meta-90
139136
uses: docker/metadata-action@v4.3.0
140137
with:
141-
flavor: |
142-
latest=auto
143138
images: |
139+
registry.internal.huggingface.tech/text-embeddings-inference
144140
ghcr.io/huggingface/text-embeddings-inference
145141
tags: |
146142
type=semver,pattern=hopper-{{version}}
@@ -151,9 +147,8 @@
151147
id: meta-cpu
152148
uses: docker/metadata-action@v4.3.0
153149
with:
154-
flavor: |
155-
latest=auto
156150
images: |
151+
registry.internal.huggingface.tech/text-embeddings-inference
157152
ghcr.io/huggingface/text-embeddings-inference
158153
tags: |
159154
type=semver,pattern=cpu-{{version}}
@@ -174,6 +169,8 @@
174169
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}
175170
tags: ${{ steps.meta-75.outputs.tags }}
176171
labels: ${{ steps.meta-75.outputs.labels }}
172+
cache-from: type=registry,ref=registry.internal.huggingface.tech/text-embeddings-inference:cache,mode=max
173+
cache-to: type=registry,ref=registry.internal.huggingface.tech/text-embeddings-inference:cache,mode=max
177174
- name: Build and push Docker image
178175
id: build-and-push-80
179176
uses: docker/build-push-action@v4
@@ -188,6 +185,8 @@
188185
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}
189186
tags: ${{ steps.meta-80.outputs.tags }}
190187
labels: ${{ steps.meta-80.outputs.labels }}
188+
cache-from: type=registry,ref=registry.internal.huggingface.tech/text-embeddings-inference:cache,mode=max
189+
cache-to: type=registry,ref=registry.internal.huggingface.tech/text-embeddings-inference:cache,mode=max
191190
- name: Build and push Docker image
192191
id: build-and-push-86
193192
uses: docker/build-push-action@v4
@@ -202,6 +201,8 @@
202201
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}
203202
tags: ${{ steps.meta-86.outputs.tags }}
204203
labels: ${{ steps.meta-86.outputs.labels }}
204+
cache-from: type=registry,ref=registry.internal.huggingface.tech/text-embeddings-inference:cache,mode=max
205+
cache-to: type=registry,ref=registry.internal.huggingface.tech/text-embeddings-inference:cache,mode=max
205206
- name: Build and push Docker image
206207
id: build-and-push-90
207208
uses: docker/build-push-action@v4
@@ -216,6 +217,8 @@
216217
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}
217218
tags: ${{ steps.meta-90.outputs.tags }}
218219
labels: ${{ steps.meta-90.outputs.labels }}
220+
cache-from: type=registry,ref=registry.internal.huggingface.tech/text-embeddings-inference:cache,mode=max
221+
cache-to: type=registry,ref=registry.internal.huggingface.tech/text-embeddings-inference:cache,mode=max
219222
- name: Build and push Docker image
220223
id: build-and-push-cpu
221224
uses: docker/build-push-action@v4
@@ -229,6 +232,8 @@
229232
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}
230233
tags: ${{ steps.meta-cpu.outputs.tags }}
231234
labels: ${{ steps.meta-cpu.outputs.labels }}
235+
cache-from: type=registry,ref=registry.internal.huggingface.tech/text-embeddings-inference:cache,mode=max
236+
cache-to: type=registry,ref=registry.internal.huggingface.tech/text-embeddings-inference:cache,mode=max
232237

233238
stop-runner:
234239
name: Stop self-hosted EC2 runner

0 commit comments

Comments
 (0)