Run Arxiv Papers Daily #3419
This file contains 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: Run Arxiv Papers Daily | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "* 0/12 * * *" #'*/60 * * * *' | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
TZ: "Asia/Shanghai" | |
RUN_ENV: "production" # within ['production', 'development'] | |
POWER: 16 | |
steps: | |
# ============================================ | |
# TODO [√] 检查工作分支及 Workflows 运行环境 | |
# ============================================ | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# ============================================ | |
# TODO [√] 创建 Python3.6+ 编译环境 | |
# ============================================ | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
# ============================================ | |
# TODO [√] 安装 Project 第三方依赖 | |
# ============================================ | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
# ============================================ | |
# TODO [√] 测试 Scaffold 脚手架指令 | |
# ============================================ | |
- name: Run daily arxiv | |
run: | | |
python main.py run --env=${{ env.RUN_ENV }} --power=${{ env.POWER }} | |
# ============================================ | |
# TODO [√] 更新仓库数据 | |
# ============================================ | |
- name: Setup GIT user | |
uses: fregante/setup-git-user@v1 | |
- name: Push done work | |
run: | | |
git add --all | |
git commit -m "Automated deployment @ $(date '+%Y-%m-%d %H:%M:%S') ${{ env.TZ }}" | |
git push --force origin main | |
# ============================================ | |
# TODO [√] 更新 mkdocs | |
# ============================================ | |
- name: Deploy docs | |
uses: mhausenblas/mkdocs-deploy-gh-pages@nomaterial | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REQUIREMENTS: requirements-mkdocs.txt |