Generate PDF #17
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: Generate PDF | |
| on: | |
| # Manual trigger | |
| workflow_dispatch: | |
| # Monthly schedule (runs on the 1st day of each month at 2 AM UTC) | |
| schedule: | |
| - cron: '0 2 1 * *' | |
| jobs: | |
| generate-pdf: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y fonts-liberation | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install Playwright browsers | |
| run: | | |
| playwright install chromium | |
| - name: Run PDF generation script | |
| run: | | |
| python main.py https://forum.shotcut.org/pub/website2pdf -L 1 -e "Opt out" | |
| - name: Upload PDF to S3 | |
| if: ${{ github.repository_owner == 'mltframework' }} | |
| uses: mltframework/s3cmd-action@v0 | |
| with: | |
| args: >- | |
| --access_key=${{ secrets.AWS_ACCESS_KEY }} | |
| --secret_key=${{ secrets.AWS_SECRET_KEY }} | |
| --acl-public | |
| --stop-on-error | |
| put *.pdf s3://misc.meltymedia/shotcut/stockmedia/ |