This commit is contained in:
parent
3d34cbd82a
commit
5ddfda604d
@ -12,21 +12,20 @@ jobs:
|
|||||||
if: "contains(github.event.head_commit.message, 'Release')"
|
if: "contains(github.event.head_commit.message, 'Release')"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 检查本地是否已经有 ubuntu-latest 镜像
|
- name: 检查本地是否已经有 gitea/runner-images:ubuntu-latest 镜像
|
||||||
id: check_ubuntu_image
|
id: check_image
|
||||||
run: |
|
run: |
|
||||||
if docker image inspect ubuntu:latest >/dev/null 2>&1; then
|
if docker image inspect gitea/runner-images:ubuntu-latest >/dev/null 2>&1; then
|
||||||
echo "Ubuntu latest image is already present locally. Skipping pull."
|
echo "gitea/runner-images:ubuntu-latest image is already present locally. Skipping pull."
|
||||||
echo "should_pull=false" >> $GITEA_OUTPUT
|
echo "should_pull=false" >> $GITEA_OUTPUT
|
||||||
else
|
else
|
||||||
echo "Ubuntu latest image is not present locally. Will pull."
|
echo "gitea/runner-images:ubuntu-latest image is not present locally. Will pull."
|
||||||
echo "should_pull=true" >> $GITEA_OUTPUT
|
echo "should_pull=true" >> $GITEA_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 本地没有镜像时,下载 ubuntu-latest
|
- name: 下载 gitea/runner-images:ubuntu-latest 镜像
|
||||||
- name: 下载 ubuntu-latest 镜像
|
if: steps.check_image.outputs.should_pull == 'true'
|
||||||
if: steps.check_ubuntu_image.outputs.should_pull == 'true'
|
run: docker pull gitea/runner-images:ubuntu-latest
|
||||||
run: docker pull ubuntu:latest
|
|
||||||
|
|
||||||
- name: 替换软件源为国内软件源
|
- name: 替换软件源为国内软件源
|
||||||
run: |
|
run: |
|
||||||
|
Loading…
Reference in New Issue
Block a user