Skip to content

tmp

tmp #34

name: Generate README previews
on:
push:
branches:
- main
jobs:
generate-readmes:
runs-on: ubuntu-latest
container:
image: archlinux:latest
defaults:
run:
working-directory: ${{ github.workspace }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update Arch and install dependencies
run: |
pacman -Syu --noconfirm
pacman -S --noconfirm git imagemagick wget base-devel pngcrush optipng bc
convert --version
bc --version
- name: Set up Git identity and safe directory
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Make scripts executable
run: chmod +x scripts/*.sh
- name: Run script to generate READMEs
run: REPO_ROOT="$GITHUB_WORKSPACE" ./scripts/build-wallpaper-pages.sh
- name: Verify generated images
run: |
find media/wlp-preview/ -name "*.png" -exec identify -verbose {} \; | head -n 20
echo "Всего сгенерировано: $(find media/wlp-preview/ -name "*.png" | wc -l) изображений"
- name: Add changes to Git stage
run: REPO_ROOT="$GITHUB_WORKSPACE" git add .
- name: Commit files
run: |
REPO_ROOT="$GITHUB_WORKSPACE" git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
REPO_ROOT="$GITHUB_WORKSPACE" git config user.name "github-actions[bot]"
REPO_ROOT="$GITHUB_WORKSPACE" git commit -m "Auto-generate wallpaper previews [skip ci]" --allow-empty
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
force_with_lease: true