fix: try #10
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 wikis | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
sync-wikis: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository with wikis | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Sync wikis | |
run: | | |
git submodule foreach ' | |
echo "Updating wiki: $name" | |
if git fetch origin && git reset --hard origin/master || git reset --hard origin/main; then | |
echo "Successfully updated $name" | |
else | |
echo "Failed to update $name" >&2 | |
exit 1 | |
fi | |
' | |
- name: Commit and push changes | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
if git diff-index --quiet HEAD; then | |
echo "No changes detected" | |
else | |
git add . | |
git commit -m "Sync wikis to latest commits" | |
git push | |
fi | |
- name: Install Bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: 1.2.0 | |
- name: Install dependencies | |
run: | | |
bun install | |
- name: Build site | |
run: | | |
bun run build | |
- name: Deploy github pages | |
run: | | |
bun run deploy | |
env: | |
GIT_USER: ${{ secrets.GITHUB_ACTOR }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |