add more wallpaper 21/07/26 #42
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: Deploy Wallpaper Gallery | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Cache Metadata and Thumbnails | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| thumbnails | |
| wallpapers.json | |
| key: ${{ runner.os }}-wallpaper-cache-${{ github.run_id }} | |
| restore-keys: | | |
| ${{ runner.os }}-wallpaper-cache- | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y imagemagick | |
| python -m pip install --upgrade pip | |
| pip install Pillow | |
| - name: Generate Metadata & Thumbnails | |
| run: python .github/scripts/generate_metadata.py | |
| - name: Prepare HTML | |
| run: cp .github/scripts/template.html index.html | |
| - name: Install Tailwind CLI & Build CSS | |
| run: | | |
| curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 | |
| chmod +x tailwindcss-linux-x64 | |
| ./tailwindcss-linux-x64 -i .github/scripts/input.css -o style.css --minify | |
| - name: Deploy to GH Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: . | |
| publish_branch: gh-pages | |
| force_orphan: true | |
| exclude_assets: '.github,README.md,tailwindcss-linux-x64' |