generated from gouef/github-lib-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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
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 }} |