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 README previews | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
generate-readmes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y bc wget pngcrush optipng | |
# Установка последней версии ImageMagick 7 | |
sudo add-apt-repository -y ppa:imagemagick/archive | |
sudo apt-get update | |
sudo apt-get install -y imagemagick | |
convert --version | |
- name: Set up Git identity | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Make scripts executable | |
run: chmod +x scripts/*.sh | |
- name: Run script to generate READMEs | |
run: | | |
echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE" | |
REPO_ROOT="$GITHUB_WORKSPACE" ./scripts/build-wallpaper-pages.sh | |
- name: Verify Git status | |
run: | | |
echo "Проверка Git статуса:" | |
git status | |
echo "Текущая директория: $(pwd)" | |
echo "Содержимое:" | |
ls -la | |
echo "Сгенерированные изображения:" | |
find media/wlp-preview/ -name "*.png" | wc -l | |
- name: Add changes to Git stage | |
run: git add . | |
- name: Commit files | |
run: | | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
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 |