Skip to content

Commit 893c7cd

Browse files
committed
ci: reduce image size
Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent 960332b commit 893c7cd

4 files changed

Lines changed: 196 additions & 249 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*.tfstate.*
1919
*.tfvars
2020
*.tfvars.*
21+
*.local.json
2122

2223
# Dirs
2324
/.idea

.github/workflows/ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,26 @@ jobs:
128128
uses: actions/cache@v4
129129
with:
130130
path: |-
131-
${{ github.workspace }}/.cache
131+
${{ github.workspace }}/.cache/go-build
132+
${{ github.workspace }}/.cache/go-mod
132133
${{ github.workspace }}/.sbin
133134
key: ci-${{ matrix.platform }}-${{ hashFiles('go.sum') }}
134135
- name: Restore BuildX Cache
135136
uses: reproducible-containers/buildkit-cache-dance@v3
136137
with:
137138
builder: ${{ steps.setup-buildx.outputs.name }}
138-
cache-dir: ${{ github.workspace }}/.cache
139+
cache-map: |-
140+
{
141+
"${{ github.workspace }}/.cache/go-build": {
142+
"target": "/root/.cache/go-build"
143+
},
144+
"${{ github.workspace }}/.cache/go-mod": {
145+
"target": "/go/pkg/mod"
146+
},
147+
"${{ github.workspace }}/.sbin": {
148+
"target": "/usr/local/go/src/gpustack.ai/gpustack/.sbin"
149+
}
150+
}
139151
dockerfile: ${{ github.workspace }}/pack/${{ env.INPUT_REPOSITORY }}/Dockerfile
140152
skip-extraction: ${{ steps.setup-buildx-cache.outputs.cache-hit }}
141153
- name: Login DockerHub

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ go.work.*
2020
*.tfstate.*
2121
*.tfvars
2222
*.tfvars.*
23+
*.local.json
2324

2425
# Dirs
2526
/.idea

0 commit comments

Comments
 (0)