Ein normaler git clone holt Submodules nicht mit - geprueft: nach dem Klonen des Repos war themes/gokarna leer. Portainer klont ebenso, der Build im Container waere also an dem fehlenden Theme gescheitert. Gokarna liegt jetzt direkt im Repo, festgeschrieben auf Commit 8306042, den Stand, mit dem die Seite bisher gebaut wurde. .gitmodules entfaellt. Nachteil: Theme-Updates muessen kuenftig von Hand eingespielt werden. Dafuer baut das Repo aus jedem beliebigen Klon heraus, ohne Sonderbehandlung. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
39 lines
1.0 KiB
YAML
39 lines
1.0 KiB
YAML
name: Update screenshots
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
update-screenshots:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: write
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Check out the code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Run screenshotter container
|
|
run: docker run -v $(pwd):/app ghcr.io/gokarna-theme/gokarna-hugo/screenshotter
|
|
|
|
- name: Create PR
|
|
run: |
|
|
if [[ -z $(git status images --porcelain) ]]; then
|
|
echo "No changes found"
|
|
exit 0
|
|
fi
|
|
|
|
git config --global user.name 'github-actions[bot]'
|
|
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
|
git checkout -b auto-update-screenshots
|
|
git add images/
|
|
git commit -m 'chore: update screenshots'
|
|
git push origin auto-update-screenshots -f
|
|
gh pr create -B main -H auto-update-screenshots --title 'chore: update screenshots' --body 'Created by GitHub action'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|