Generate README #144
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 README | |
on: | |
workflow_dispatch: | |
issues: | |
types: [opened, edited] | |
schedule: | |
- cron: "0 16 * * *" | |
jobs: | |
build: | |
name: Generate blog | |
runs-on: ubuntu-20.04 | |
if: ${{ github.event.repository.owner.id == github.event.sender.id || github.event_name == 'schedule' }} | |
permissions: write-all | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
cache: pip | |
cache-dependency-path: "requirements.txt" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
# python -m venv venv | |
# source venv/bin/activate | |
pip install -r requirements.txt | |
- name: Generate new md | |
run: | | |
# source venv/bin/activate | |
python main.py ${{ secrets.G_T }} ${{ github.repository }} --issue_number '${{ github.event.issue.number }}' | |
- name: update html | |
run: | | |
git config --local user.email "" | |
git config --local user.name "${{ github.repository_owner }}" | |
git add . | |
git commit -a -m '🎉auto update by ChinoBing Blog action' || echo "nothing to commit" | |
git push || echo "nothing to push" | |
sleep 3 | |