Skip to content

Build AI-friendly MD #1456

Build AI-friendly MD

Build AI-friendly MD #1456

Workflow file for this run

name: Build AI-friendly MD
on:
schedule:
- cron: "0 */6 * * *" # каждые 6 часов
workflow_dispatch: # запуск вручную из GitHub UI
push:
paths:
- "scripts/AI_friendly.py"
- "**.md"
- "!structured_md/**"
concurrency:
group: "blog-deploy"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
pip install pyyaml markdown beautifulsoup4 jsonschema lxml requests
- name: Run AI_friendly.py
run: |
python scripts/AI_friendly.py
- name: Commit changes
env:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add structured_md
if ! git diff --cached --quiet; then
git commit -m "Auto-update structured_md ($(date -u +'%Y-%m-%d %H:%M:%S'))"
# Push с токеном напрямую
git push https://x-access-token:${PAT_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:main
fi