This commit is contained in:
jeremygan2021
2026-03-20 15:47:12 +08:00
parent 5396504c67
commit a770fbfd2a

View File

@@ -26,8 +26,6 @@ env:
CONTAINER_NAME: checkin_sys-container CONTAINER_NAME: checkin_sys-container
LOCAL_PORT: 8800 LOCAL_PORT: 8800
CONTAINER_PORT: 8800 CONTAINER_PORT: 8800
# 使用国内镜像源加速 Actions
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs: jobs:
build: build:
@@ -36,19 +34,31 @@ jobs:
steps: steps:
- name: 设置国内镜像源 - name: 设置国内镜像源
env:
# 使用 ghproxy 代理 GitHub 资源
GH_PROXY: https://ghproxy.com/
run: | run: |
# 配置 git 代理
git config --global url."https://ghproxy.com/".insteadOf "https://github.com/" git config --global url."https://ghproxy.com/".insteadOf "https://github.com/"
git config --global url."https://github.com/".insteadOf "https://ghproxy.com/https://github.com/"
- name: 配置 Docker 镜像源
run: |
sudo mkdir -p /etc/docker
| sudo tee /etc/docker/daemon.json << 'EOF'
{
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
]
}
EOF
sudo service docker restart || true
- name: 检出代码 - name: 检出代码
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: 设置 Buildx - name: 设置 Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
with:
driver-opts: |
image=moby/buildkit:buildx-stable-1
- name: 提取架构信息 - name: 提取架构信息
id: arch id: arch
@@ -87,11 +97,22 @@ jobs:
steps: steps:
- name: 设置国内镜像源 - name: 设置国内镜像源
env:
GH_PROXY: https://ghproxy.com/
run: | run: |
git config --global url."https://ghproxy.com/".insteadOf "https://github.com/" git config --global url."https://ghproxy.com/".insteadOf "https://github.com/"
git config --global url."https://github.com/".insteadOf "https://ghproxy.com/https://github.com/"
- name: 配置 Docker 镜像源
run: |
sudo mkdir -p /etc/docker
| sudo tee /etc/docker/daemon.json << 'EOF'
{
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com"
]
}
EOF
sudo service docker restart || true
- name: 检出代码 - name: 检出代码
uses: actions/checkout@v4 uses: actions/checkout@v4