Files
chat-one-service/.gitea/workflows/reusable-ci.yml
alboped 3076b7ec54
Some checks failed
CI / ci (push) Failing after 2s
chore: 重构 CI/CD 与 Docker 发布流程
将部署链路调整为 CI 构建推送镜像、服务器拉取镜像运行,并拆分/复用 Gitea workflow 与公共准备脚本;同时统一 APP_NAME 与端口变量配置,补充 Docker 与 ESLint 相关配置文件以提升可维护性。

Made-with: Cursor
2026-04-28 01:44:37 +08:00

52 lines
1.3 KiB
YAML
Raw 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.
name: Reusable CI
on:
workflow_call:
inputs:
node_major:
description: "Node 主版本(例如 22"
required: false
type: string
default: "22"
yarn_version:
description: "Yarn 版本(例如 stable 或 1.22.22"
required: false
type: string
default: "stable"
run_lint:
description: "是否执行 yarn lint"
required: false
type: boolean
default: true
run_tsc:
description: "是否执行 yarn tsc --noEmit"
required: false
type: boolean
default: true
jobs:
ci:
runs-on: ubuntu-latest
env:
NODE_MAJOR: ${{ inputs.node_major }}
YARN_VERSION: ${{ inputs.yarn_version }}
steps:
- name: Prepare workspace (checkout + node/yarn)
run: |
set -euo pipefail
chmod +x .gitea/scripts/prepare-workspace.sh
./.gitea/scripts/prepare-workspace.sh \
"${{ github.server_url }}/${{ github.repository }}.git" \
"${{ github.sha }}"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
if: ${{ inputs.run_lint }}
run: yarn lint
- name: TypeScript check
if: ${{ inputs.run_tsc }}
run: yarn tsc --noEmit