部署到 GitHub Pages #353
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 部署到 GitHub Pages | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| schedule: | |
| # 每日北京时间中午12点(UTC 4:00)运行爬取和生成任务 | |
| - cron: '0 4 * * *' | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 检出代码 | |
| uses: actions/checkout@v4 | |
| - name: 设置 Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: 设置 Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: 安装依赖 | |
| run: | | |
| pip install -r requirements.txt | |
| - name: 安装 Playwright 依赖 | |
| run: | | |
| npm install | |
| npx playwright install --with-deps chromium | |
| - name: 运行 arXiv 爬虫 | |
| run: | | |
| python scripts/arxiv_crawler.py | |
| env: | |
| MODELSCOPE_ACCESS_TOKEN: ${{ secrets.MODELSCOPE_ACCESS_TOKEN }} | |
| ARXIV_QUERY_KEYWORD: 'all:"VLA" OR all:"Vision-Language-Action" OR all:"World Action Model" OR all:"World-Action Model" OR all:"action world model"' | |
| ARXIV_DAILY_RESULTS: 80 | |
| ARXIV_PAGE_SIZE: 10 | |
| ARXIV_DELAY_SECONDS: 15 | |
| ARXIV_RETRY_BASE_SECONDS: 60 | |
| ARXIV_MAX_RETRIES: 4 | |
| - name: 生成论文摘要 | |
| run: | | |
| python scripts/generate_summaries.py | |
| env: | |
| MODELSCOPE_ACCESS_TOKEN: ${{ secrets.MODELSCOPE_ACCESS_TOKEN }} | |
| MODELSCOPE_MODELS: moonshotai/Kimi-K2.6,deepseek-ai/DeepSeek-V4-Pro,ZhipuAI/GLM-5.1,XiaomiMiMo/MiMo-V2.5-Pro,stepfun-ai/Step-3.7-Flash | |
| - name: 抓取论文首图 | |
| run: | | |
| python scripts/fetch_paper_images.py --max-items 30 | |
| - name: 生成首图截图兜底队列 | |
| run: | | |
| python scripts/build_paper_image_fallback_queue.py --max-items 20 | |
| - name: Playwright 截图兜底 | |
| run: | | |
| npm run paper-image:fallbacks | |
| - name: 注册截图兜底首图 | |
| run: | | |
| python scripts/register_paper_image_fallbacks.py | |
| - name: 构建网站 | |
| run: | | |
| python scripts/build_site.py | |
| env: | |
| ARXIV_QUERY_KEYWORD: 'all:"VLA" OR all:"Vision-Language-Action" OR all:"World Action Model" OR all:"World-Action Model" OR all:"action world model"' | |
| - name: 提交更改 | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add papers.md | |
| git add -f site | |
| if git diff --staged --quiet; then | |
| echo "没有更改需要提交" | |
| else | |
| CURRENT_DATE=$(date '+%Y-%m-%d') | |
| git commit -m "自动更新:爬取新论文并生成摘要 - $CURRENT_DATE [skip ci]" | |
| git push | |
| fi | |
| - name: 设置 Pages | |
| uses: actions/configure-pages@v5 | |
| - name: 上传构建产物 | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: './site' | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: 部署到 GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |