Blog: Write new blog #13
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: Blog Automation | |
| on: | |
| push: | |
| paths: | |
| - '_posts/**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| process-blog: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.9' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: 1. Manage Blog Time Lifecycle | |
| run: python scripts/blog_lifecycle_manager.py | |
| - name: 2. AI Tagging | |
| env: | |
| DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} | |
| run: | | |
| python scripts/auto_tagger.py | |
| python scripts/extract_subject.py | |
| - name: 3. Atomic Commit and Push | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action [Bot]" | |
| git add _posts/*.md | |
| git diff --staged --quiet || ( | |
| git commit -m "Automated: Blog Automation (Lifecycle & AI Tags)" | |
| git pull --rebase origin main | |
| git push | |
| ) |