Update Jadi Blog Posts #52
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: Update Jadi Blog Posts | |
on: | |
schedule: | |
- cron: "0 0 */2 * *" | |
workflow_dispatch: | |
jobs: | |
update_posts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Update from repository | |
run: | | |
git config --global user.name "Max Base (Actions)" | |
git config --global user.email "maxbasecode+githubactions@gmail.com" | |
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/BaseMax/jadi-net-blog.git | |
git pull origin main | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Run the Python script to fetch posts | |
run: | | |
python extract_posts.py | |
- name: Commit and push changes | |
run: | | |
git add . | |
git commit -m "Automated commit" | |
git push origin main |