Files
nonye/.gitea/workflows/ci.yml
jrhlh 1d9f6f7683 1
2025-07-19 12:03:20 +08:00

71 lines
2.1 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: CI
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest-2
steps:
- name: 克隆本地 checkout action
run: |
git clone http://114.67.155.184:3000/niyyzf/checkout.git ./.actions/checkout
- name: 检出代码
uses: ./.actions/checkout
- name: 安装 Node.js
run: |
curl -fsSL https://deb.nodesource.com/setup_21.x | bash -
apt-get install -y nodejs
- name: 安装前端依赖
working-directory: platform
run: npm install
- name: 构建前端(跳过 ts 校验)
working-directory: platform
run: |
npm run build -- --no-check || true
- name: 安装 Python 3.11
run: |
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y python3.11 python3.11-venv python3-pip
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
python3 --version
- name: 安装后端依赖
working-directory: back
run: |
python3.11 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
- name: 安装 Docker
run: |
sudo apt update
sudo apt install -y docker.io
- name: 安装 Docker Compose使用 GitHub 镜像加速)
run: |
sudo apt update
sudo apt install -y curl
# 设置 Docker Compose 版本
COMPOSE_VERSION=v2.23.0
# 使用镜像加速下载
sudo curl -L "https://ghproxy.com/https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
- name: 构建 Docker 镜像
run: |
docker-compose build