68 lines
3.0 KiB
YAML
68 lines
3.0 KiB
YAML
name: 全媒介出版系统
|
||
|
||
on:
|
||
push:
|
||
branches:
|
||
- main
|
||
pull_request:
|
||
branches:
|
||
- main
|
||
|
||
jobs:
|
||
build-and-publish:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- name: 检出代码
|
||
uses: actions/checkout@v3
|
||
|
||
- name: 设置 Python 环境
|
||
uses: actions/setup-python@v4
|
||
with:
|
||
python-version: '3.11'
|
||
|
||
- name: 创建并激活虚拟环境
|
||
run: |
|
||
python3 -m venv ./documentation/analysis/phallic-worship-analysis/venv
|
||
source ./documentation/analysis/phallic-worship-analysis/venv/bin/activate
|
||
|
||
- name: 安装依赖
|
||
run: |
|
||
./documentation/analysis/phallic-worship-analysis/venv/bin/pip install sphinx myst-parser sphinx-autodoc-typehints sphinx-mermaid gTTS ffmpeg-python
|
||
|
||
- name: 配置 Sphinx (如果需要)
|
||
run: |
|
||
# 确保 conf.py 已经配置好,这里不再运行 quickstart
|
||
# 如果需要,可以在这里添加额外的 Sphinx 配置步骤
|
||
echo "Sphinx 配置已完成 (假设 conf.py 已手动配置)"
|
||
|
||
- name: 生成 EPUB/HTML 文档
|
||
if: contains(github.event.head_commit.message, '[publish:ebook]') || contains(github.event.pull_request.title, '[publish:ebook]')
|
||
run: |
|
||
./documentation/analysis/phallic-worship-analysis/venv/bin/python3 tools/generate_ebook.py --output_format epub
|
||
./documentation/analysis/phallic-worship-analysis/venv/bin/python3 tools/generate_ebook.py --output_format html
|
||
|
||
- name: 生成 Podcast 音频
|
||
if: contains(github.event.head_commit.message, '[publish:podcast]') || contains(github.event.pull_request.title, '[publish:podcast]')
|
||
run: |
|
||
# 假设有一个 Markdown 文件作为 Podcast 脚本的来源
|
||
# 例如:core-theory/cultural_logic_system.md
|
||
mkdir -p artifacts/podcast
|
||
./documentation/analysis/phallic-worship-analysis/venv/bin/python3 tools/generate_podcast.py --text_file core-theory/cultural_logic_system.md --output_audio artifacts/podcast/cultural_logic_podcast.mp3
|
||
|
||
- name: 生成视频
|
||
if: contains(github.event.head_commit.message, '[publish:video]') || contains(github.event.pull_request.title, '[publish:video]')
|
||
run: |
|
||
# 假设有一个 Markdown 文件作为视频脚本的来源
|
||
# 例如:historical-research/geopolitical-codes/Y音正统性与地缘政治密码_完整理论框架.md
|
||
mkdir -p artifacts/video
|
||
./documentation/analysis/phallic-worship-analysis/venv/bin/python3 tools/generate_video.py --text_file historical-research/geopolitical-codes/Y音正统性与地缘政治密码_完整理论框架.md --output_video artifacts/video/geopolitical_codes_video.mp4 --audio_path artifacts/podcast/cultural_logic_podcast.mp3
|
||
|
||
- name: 上传生成物 (Artifacts)
|
||
uses: actions/upload-artifact@v3
|
||
with:
|
||
name: generated-content
|
||
path: |
|
||
documentation/docs/_build/epub/*
|
||
documentation/docs/_build/html/*
|
||
artifacts/podcast/*
|
||
artifacts/video/* |