8850c94e96
Deploy Server / deploy-server (push) Failing after 2m16s
catthehacker ubuntu:act-latest 自带 node 不带 go;直接 go build 报 command not found。 加 Setup Go 步骤从 golang.google.cn(CN 镜像, 避开墙内不稳的 go.dev)装 1.25.10。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
54 lines
1.8 KiB
YAML
54 lines
1.8 KiB
YAML
name: Deploy Server
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'server-v[0-9]*.[0-9]*.[0-9]*'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: deploy-server
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
deploy-server:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
# runner 镜像(catthehacker ubuntu:act-latest,label ubuntu-latest)自带 node
|
|
# 但**不带 go** → 直接 `go build` 会 `go: command not found`(exit 127)。
|
|
# 故先装 go:从 Go 官方**中国镜像** golang.google.cn 取(go.dev 在墙内不稳),
|
|
# 版本对齐 server/go.mod 的 1.25.10;装到 /usr/local/go 并加进 $GITHUB_PATH
|
|
# 供后续 Compile/Test 步骤共用。模块下载仍走 GOPROXY=goproxy.cn(见 _env.sh)。
|
|
- name: Setup Go 1.25.10(CN 镜像)
|
|
run: |
|
|
GO_VER=1.25.10
|
|
curl -fsSL "https://golang.google.cn/dl/go${GO_VER}.linux-amd64.tar.gz" -o /tmp/go.tgz
|
|
rm -rf /usr/local/go
|
|
tar -C /usr/local -xzf /tmp/go.tgz
|
|
echo "/usr/local/go/bin" >> "$GITHUB_PATH"
|
|
export PATH=/usr/local/go/bin:$PATH
|
|
go version
|
|
|
|
# 直接在 runner 跑(不嵌套 docker,避免 DinD 挂载失败;go 由上一步装好)。
|
|
- name: Compile (Go 控制面)
|
|
run: bash scripts/ci/compile-backend.sh
|
|
|
|
- name: Test (go test)
|
|
run: bash scripts/ci/test.sh server
|
|
|
|
- name: Release → Forgejo
|
|
env:
|
|
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
|
FORGEJO_URL: ${{ secrets.FORGEJO_URL }}
|
|
TAG: ${{ gitea.ref_name }}
|
|
run: bash scripts/ci/release-server.sh "$TAG"
|
|
|
|
- name: Deploy → pangolin1
|
|
env:
|
|
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
|
TAG: ${{ gitea.ref_name }}
|
|
run: bash scripts/ci/deploy-server.sh "$TAG"
|