Skip to content

Commit 07656cc

Browse files
committed
fix(ci): 兼容多种 artifact 解压结构
Made-with: Cursor
1 parent 3253d28 commit 07656cc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,16 @@ jobs:
6868
name: dist
6969

7070
- name: Prepare docker context
71-
run: cp -r _build/dist frontend/docker/
71+
run: |
72+
if [ -d dist ]; then
73+
cp -r dist frontend/docker/
74+
elif [ -d _build/dist ]; then
75+
cp -r _build/dist frontend/docker/
76+
else
77+
# artifact 可能把内容解压到根目录
78+
mkdir -p frontend/docker/dist
79+
cp -r index.html assets frontend/docker/dist/ 2>/dev/null || (echo "Artifact structure:" && find . -maxdepth 3 -type d && exit 1)
80+
fi
7281
7382
- name: Set up Docker Buildx
7483
uses: docker/setup-buildx-action@v3

0 commit comments

Comments
 (0)