fix(ci): replace GitHub actions/checkout with internal Gitea clone (no github.com egress)
deploy-userbase-front / build-and-deploy (push) Failing after 45s

This commit is contained in:
chenxing
2026-08-04 21:51:55 +08:00
parent a94140fdb8
commit 6c4d800c26
2 changed files with 17 additions and 4 deletions
+7 -3
View File
@@ -10,15 +10,19 @@ on:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
# node:20 自带 npm;通过已配置的 registry-mirrors 拉取
# node:20 自带 npm 与 git;通过已配置的 registry-mirrors 拉取
container:
image: node:20
# 显式把宿主静态目录挂进 job 容器(act_runner 会校验 valid_volumes 白名单)
volumes:
- /data/www/userbase:/data/www/userbase
steps:
- name: Checkout
uses: actions/checkout@v4
# 内网 Gitea 无法访问 github.com 拉取 actions/checkout,改为直接 clone 本仓库
- name: Checkout (manual, internal Gitea)
run: |
git clone --depth 1 --branch main http://192.168.10.160:3000/${GITHUB_REPOSITORY}.git /tmp/src
cp -a /tmp/src/. .
rm -rf /tmp/src
- name: Use npm mirror (npmmirror)
working-directory: front
+10 -1
View File
@@ -23,7 +23,16 @@ jobs:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
steps:
- uses: actions/checkout@v4
# docker:24 基于 alpine,默认无 git;先装 git 再手动 clone 本仓库
- name: Install git (alpine)
run: apk add --no-cache git
# 内网 Gitea 无法访问 github.com 拉取 actions/checkout,改为直接 clone 本仓库
- name: Checkout (manual, internal Gitea)
run: |
git clone --depth 1 --branch main http://192.168.10.160:3000/${GITHUB_REPOSITORY}.git /tmp/src
cp -a /tmp/src/. .
rm -rf /tmp/src
- name: Login to Nexus docker registry
run: echo "${{ secrets.NEXUS_PASSWORD }}" | docker login nexus:8083 -u ${{ secrets.NEXUS_USER }}