Update Builds #28
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: Update Builds | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Runs daily at midnight | |
| workflow_dispatch: # Allows manual triggering | |
| jobs: | |
| update-content: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Needed to commit changes | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: microkeebs | |
| - name: Fetch new builds from YouTube | |
| env: | |
| YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }} | |
| YOUTUBE_MX_PLAYLIST_ID: ${{ secrets.YOUTUBE_MX_PLAYLIST_ID }} | |
| YOUTUBE_EC_PLAYLIST_ID: ${{ secrets.YOUTUBE_EC_PLAYLIST_ID }} | |
| run: node src/data/extract.cjs | |
| working-directory: microkeebs | |
| - name: Optimize images | |
| run: node src/data/optimize_images.mjs | |
| working-directory: microkeebs | |
| - name: Commit changes | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "chore: update builds and optimize images" | |
| file_pattern: "microkeebs/src/data/builds.json microkeebs/public/images/**/*" |