Skip to content

Sync Posts

Sync Posts #35

Workflow file for this run

name: Sync Posts
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
sync-posts:
runs-on: ubuntu-latest
environment: Website
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install dependencies
run: python -m pip install -r requirements.txt
- name: Export WordPress posts
env:
API_URL: ${{ secrets.API_URL }}
USERNAME: ${{ secrets.USERNAME }}
APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
run: |
python export_posts.py
- name: Commit and push changes
run: |
git config --local user.name "${{ secrets.GIT_USER_NAME }}"
git config --local user.email "${{ secrets.GIT_USER_EMAIL }}"
git add .
git commit -m "Update WordPress posts on $(date)"
git push
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
branch: sync-wordpress-posts
commit-message: "Sync WordPress posts"
title: "Daily WordPress Post Sync"
body: "This PR syncs posts from WordPress to this repo."