Update run_pipeline.py #9
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: Convert and Deploy Song Notations | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'songs_reformatted.docx' | |
| - 'reformat.py' | |
| - 'convert_and_push.py' | |
| - 'render_and_watermark.py' | |
| - 'run_pipeline.py' | |
| workflow_dispatch: # Allow manual trigger | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| convert-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| persist-credentials: true | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install Playwright browsers | |
| run: | | |
| playwright install chromium | |
| - name: Run Complete Pipeline | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| python run_pipeline.py | |
| - name: Commit and push changes | |
| run: | | |
| git add output/ | |
| git diff --staged --quiet || git commit -m "Auto-update: Generated HTML and PNG from DOCX [$(date)]" | |
| git push | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./output | |
| publish_branch: gh-pages |