Update Blog Posts #364
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: Update Blog Posts | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '59 23 * * *' # Runs daily at 11:59 PM | |
jobs: | |
update_blog: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
pip install feedparser gitpython googletrans==4.0.0-rc1 | |
- name: Run update script | |
run: python scripts/update_blog.py | |
- name: Configure Git | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Commit changes | |
run: | | |
git add . | |
git commit -m "Update blog posts" || echo "No changes to commit" | |
- name: Push changes | |
env: | |
GH_PAT: ${{ secrets.GH_PAT }} | |
run: | | |
git push https://${GH_PAT}@github.com/becooq81/velog.git |