Merge pull request #1 from libdebug/new-ci #5
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: Sync libdebug gh-pages into main | |
on: | |
push: | |
branches: [main] | |
repository_dispatch: | |
types: [refresh_rolling] | |
jobs: | |
sync: | |
if: github.actor != 'github-actions[bot]' | |
runs-on: ubuntu-latest | |
permissions: { contents: write } | |
steps: | |
- uses: actions/checkout@v4 | |
with: { fetch-depth: 0 } | |
- name: Checkout libdebug gh-pages | |
uses: actions/checkout@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
repository: libdebug/libdebug | |
ref: gh-pages | |
path: libdebug-pages | |
fetch-depth: 1 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Sync files | |
run: | | |
rsync -av libdebug-pages/ ./ \ | |
--exclude '.git' --exclude '.github/**' | |
rm -rf libdebug-pages | |
- name: Commit & push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
if git diff --quiet; then | |
echo "✅ Nothing to commit." | |
else | |
git add --all | |
git commit -m "docs: sync content from libdebug@gh-pages" | |
git push origin HEAD | |
fi |