Generate Daily Markdown #4
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: Generate Daily Markdown | |
on: | |
schedule: | |
- cron: '10 8 * * *' # 每天UTC时间早上8:10(北京时间下午4:10自动运行) | |
workflow_dispatch: # 手动触发 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 # 更新到v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 # 更新到v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Generate Markdown | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
PRODUCTHUNT_CLIENT_ID: ${{ secrets.PRODUCTHUNT_CLIENT_ID }} | |
PRODUCTHUNT_CLIENT_SECRET: ${{ secrets.PRODUCTHUNT_CLIENT_SECRET }} | |
PRODUCTHUNT_TOKEN: ${{ secrets.PRODUCTHUNT_TOKEN }} | |
run: | | |
python scripts/product_hunt_list_to_md.py | |
- name: Commit and push | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add . | |
git commit -m "Generated daily content" | |
git push origin main |