Files
foundry-core/.gitea/workflows/deploy.yml

48 lines
1.6 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 仅 main 的相关路径变更触发发布;工作分支验证不应运行此生产切换。
name: Deploy Foundry Core
on:
push:
branches: [main]
paths:
- 'cmd/**'
- 'internal/**'
- 'go.mod'
- 'go.sum'
- 'deploy/**'
- 'db/**'
- '.gitea/workflows/deploy.yml'
# 发布串行排队且不取消正在进行的路由/数据库操作。
concurrency:
group: foundry-core-main-deploy
cancel-in-progress: false
jobs:
deploy:
if: gitea.ref == 'refs/heads/main' && gitea.event_name == 'push'
runs-on: ces-control
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
# 在远程 runner 生成无 CGO 二进制,供只读 slim 容器执行。
- name: Verify and build
run: |
set -eu
test -z "$(gofmt -l cmd internal)"
go test -mod=readonly ./...
CGO_ENABLED=0 go build -mod=readonly -o bin/foundry ./cmd/foundry
# secrets 仅注入进程环境,项目/引导 JSON 来自 Actions Variables,release 再检查内容。
- name: Deploy and verify backend readiness
env:
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
SLACK_CLIENT_ID: ${{ secrets.SLACK_CLIENT_ID }}
SLACK_CLIENT_SECRET: ${{ secrets.SLACK_CLIENT_SECRET }}
FOUNDRY_PROJECTS: ${{ vars.FOUNDRY_PROJECTS }}
FOUNDRY_ONBOARDING: ${{ vars.FOUNDRY_ONBOARDING }}
run: bash deploy/release.sh bin/foundry