ci: 改用 container.options 挂载 /opt/freedom(docker.sock 由 runner 自动挂载)
CI/CD Deploy (Web) / 构建前端镜像并部署 (push) Failing after 10m23s
CI/CD Deploy (Web) / 构建前端镜像并部署 (push) Failing after 10m23s
This commit is contained in:
@@ -2,15 +2,12 @@
|
||||
# freedom-web CI/CD 工作流(前端)
|
||||
# 触发条件:push 到 master 分支时自动构建并部署
|
||||
#
|
||||
# 环境(同 freedom-admin,见其 workflow 注释):
|
||||
# - runner labels: ubuntu-latest
|
||||
# - job 容器挂载 /var/run/docker.sock 与 /opt/freedom(由本 workflow 的 volumes 声明,
|
||||
# 经 runner-config.yml 的 valid_volumes 白名单放行;host.docker.internal 由 options 解析)
|
||||
# 环境说明同 freedom-admin:
|
||||
# - /var/run/docker.sock 由 act_runner 自动挂载,不可重复声明
|
||||
# - /opt/freedom 经 container.options 的 -v 挂载(依赖 valid_volumes 白名单)
|
||||
# - host.docker.internal 由 options 的 --add-host 解析
|
||||
# - act_runner 不自动检出代码,需自行 git clone
|
||||
# - 部署目录:/opt/freedom/deploy
|
||||
#
|
||||
# 前置条件(管理员一次性完成):
|
||||
# - 宿主 /opt/freedom/deploy/docker-compose.yml 与 .env 已就位
|
||||
# (web 服务本身不需要数据库,但 compose 文件解析 backend 服务时需要)
|
||||
# =============================================================
|
||||
name: CI/CD Deploy (Web)
|
||||
|
||||
@@ -26,11 +23,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker:24.0-cli
|
||||
# 挂载与 host 解析:workflow 级 volumes/options + runner-config valid_volumes 白名单
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /opt/freedom:/opt/freedom
|
||||
options: --add-host=host.docker.internal:host-gateway
|
||||
options: -v /opt/freedom:/opt/freedom --add-host=host.docker.internal:host-gateway
|
||||
steps:
|
||||
- name: 安装 git
|
||||
run: apk add --no-cache git
|
||||
|
||||
Reference in New Issue
Block a user