-
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
1 parent
99de6a9
commit 110f188
Showing
1 changed file
with
22 additions
and
25 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,37 +1,34 @@ | ||
name: Update Wiki | ||
name: Sync README to Wiki | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
update-wiki: | ||
sync-readme: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set the wiki URL and the wiki README file path | ||
run: | | ||
WIKI_URL="https://github.com/$GITHUB_REPOSITORY.wiki.git" | ||
README_FILE="README.md" | ||
WIKI_README_FILE="Home.md" | ||
|
||
mkdir wiki | ||
cd wiki | ||
git clone $WIKI_URL . | ||
steps: | ||
- name: Checkout base code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: base-code | ||
|
||
- name: Set up Git user | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Julian Prieber" | ||
- name: Checkout wiki code | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ github.repository }}.wiki | ||
path: wiki | ||
|
||
- name: Copy README to wiki | ||
run: cp ../$README_FILE $WIKI_README_FILE | ||
- name: Copy README.md to wiki | ||
run: | | ||
cp base-code/README.md wiki/README.md | ||
- name: Commit and push changes | ||
run: | | ||
git add $WIKI_README_FILE | ||
git commit -m "Update Wiki README from main README" || echo "No changes to commit" | ||
git push | ||
- name: Push to wiki | ||
run: | | ||
cd wiki | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Julian Prieber" | ||
git add README.md | ||
git diff-index --quiet HEAD || git commit -m "Sync README.md to wiki" && git push |