fix action cache
This commit is contained in:
@ -48,11 +48,12 @@ RUN apk update && apk add --no-cache \
|
|||||||
tree \
|
tree \
|
||||||
&& rm -rf /var/cache/apk/* \
|
&& rm -rf /var/cache/apk/* \
|
||||||
# 预装常用 GitHub Actions,避免每次执行都从 GitHub clone
|
# 预装常用 GitHub Actions,避免每次执行都从 GitHub clone
|
||||||
&& mkdir -p ${ACTIONS_CACHE_DIR} \
|
# 目录结构必须是 {owner}/{repo}@{ref} 格式
|
||||||
&& cd ${ACTIONS_CACHE_DIR} \
|
&& mkdir -p ${ACTIONS_CACHE_DIR}/actions \
|
||||||
&& git clone --depth 1 --branch v4 https://github.com/actions/checkout.git actions-checkout@v4 \
|
&& cd ${ACTIONS_CACHE_DIR}/actions \
|
||||||
&& git clone --depth 1 --branch v4 https://github.com/actions/cache.git actions-cache@v4 \
|
&& git clone --depth 1 --branch v4 https://github.com/actions/checkout.git checkout@v4 \
|
||||||
&& git clone --depth 1 --branch v4 https://github.com/actions/upload-artifact.git actions-upload-artifact@v4 \
|
&& git clone --depth 1 --branch v4 https://github.com/actions/cache.git cache@v4 \
|
||||||
&& git clone --depth 1 --branch v4 https://github.com/actions/download-artifact.git actions-download-artifact@v4 \
|
&& git clone --depth 1 --branch v4 https://github.com/actions/upload-artifact.git upload-artifact@v4 \
|
||||||
|
&& git clone --depth 1 --branch v4 https://github.com/actions/download-artifact.git download-artifact@v4 \
|
||||||
# 清理 .git 目录减少镜像体积
|
# 清理 .git 目录减少镜像体积
|
||||||
&& find ${ACTIONS_CACHE_DIR} -name ".git" -type d -exec rm -rf {} + 2>/dev/null || true
|
&& find ${ACTIONS_CACHE_DIR} -name ".git" -type d -exec rm -rf {} + 2>/dev/null || true
|
||||||
|
|||||||
Reference in New Issue
Block a user