Skip to content

Commit 2b0d33e

Browse files
author
cyk
committed
refactor(workflow): 使用默认前端仓库,移除自定义前端仓库配置
1 parent 121d089 commit 2b0d33e

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/test_docker.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ env:
2222
RELEASE_PLATFORMS: 'linux/amd64'
2323
# 👇 关键修改:强制允许推送,不用管是不是 push 事件
2424
IMAGE_PUSH: 'true'
25-
# 👇 使用自己的前端仓库
26-
FRONTEND_REPO: 'Ironboxplus/OpenList-Frontend'
25+
# 👇 使用默认的前端仓库 (OpenListTeam/OpenList-Frontend)
26+
# FRONTEND_REPO: 'Ironboxplus/OpenList-Frontend'
2727
IMAGE_TAGS_BETA: |
2828
type=ref,event=pr
2929
type=raw,value=beta-retry
@@ -47,8 +47,15 @@ jobs:
4747
- name: Get Frontend Commit SHA
4848
id: frontend-sha
4949
run: |
50-
FRONTEND_SHA=$(curl -s https://api.github.com/repos/${{ env.FRONTEND_REPO }}/commits/main | jq -r '.sha')
50+
FRONTEND_REPO="${{ env.FRONTEND_REPO }}"
51+
# 如果未设置FRONTEND_REPO,使用默认值
52+
if [ -z "$FRONTEND_REPO" ]; then
53+
FRONTEND_REPO="OpenListTeam/OpenList-Frontend"
54+
fi
55+
FRONTEND_SHA=$(curl -s https://api.github.com/repos/$FRONTEND_REPO/commits/main | jq -r '.sha')
5156
echo "sha=$FRONTEND_SHA" >> $GITHUB_OUTPUT
57+
echo "repo=$FRONTEND_REPO" >> $GITHUB_OUTPUT
58+
echo "Frontend repo: $FRONTEND_REPO"
5259
echo "Frontend repo latest commit: $FRONTEND_SHA"
5360
5461
# 缓存前端下载 - key包含前端仓库的commit SHA
@@ -57,9 +64,9 @@ jobs:
5764
uses: actions/cache@v4
5865
with:
5966
path: public/dist
60-
key: frontend-${{ env.FRONTEND_REPO }}-${{ steps.frontend-sha.outputs.sha }}
67+
key: frontend-${{ steps.frontend-sha.outputs.repo }}-${{ steps.frontend-sha.outputs.sha }}
6168
restore-keys: |
62-
frontend-${{ env.FRONTEND_REPO }}-
69+
frontend-${{ steps.frontend-sha.outputs.repo }}-
6370
6471
# 即使只构建 x64,我们也需要 musl 工具链(因为 BuildDockerMultiplatform 默认会检查它)
6572
- name: Cache Musl
@@ -80,7 +87,7 @@ jobs:
8087
run: bash build.sh beta docker-multiplatform
8188
env:
8289
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83-
FRONTEND_REPO: ${{ env.FRONTEND_REPO }}
90+
# FRONTEND_REPO 使用 build.sh 默认值 (OpenListTeam/OpenList-Frontend)
8491

8592
- name: Upload artifacts
8693
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)