Skip to content

Commit

Permalink
[Update] used wiki action
Browse files Browse the repository at this point in the history
  • Loading branch information
JanGalek committed Jan 4, 2025
1 parent 710324c commit 988bd36
Showing 1 changed file with 7 additions and 36 deletions.
43 changes: 7 additions & 36 deletions .github/workflows/wiki.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,23 @@
name: Update Wiki
name: Update Github wiki

on:
push:
branches:
- main
- master
# paths:
# - 'docs/**'

permissions:
contents: write

jobs:
update-wiki:
runs-on: ubuntu-latest

permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
- name: Clone Wiki Repository
run: |
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git ./wiki
- name: Sync Docs to Wiki
run: |
cp -R docs/ wiki/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit and Push Wiki changes
run: |
cd wiki
git add .
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "[Update] Wiki from repository docs"
git push origin master
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup
run: |
rm -R wiki/
- name: Update wiki
uses: gouef/github-wiki-sync-repository-action@main
with:
dir: "docs/"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 988bd36

Please sign in to comment.