Update Wallpapers #4
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 Wallpapers | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - '**.jpg' | |
| - '**.jpeg' | |
| - '**.png' | |
| - '**.webp' | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '16' | |
| - name: Install ImageMagick | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y imagemagick | |
| - name: Generate wallpapers.json | |
| env: | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| run: node generate-wallpapers.js | |
| - name: Commit and push if changed | |
| run: | | |
| git config --global user.name 'GitHub Actions' | |
| git config --global user.email 'actions@github.com' | |
| git add wallpapers.json | |
| git diff --quiet && git diff --staged --quiet || git commit -m "Auto-update wallpapers.json with enhanced metadata" | |
| git push |