Skip to content

Commit

Permalink
Sync wiki changes (#911)
Browse files Browse the repository at this point in the history
* Revert "Update sync-wiki.yml"

This reverts commit 0594b03.

* Sync wiki homepage to README page

* Always prefer wiki/ and README files

* Sync all wiki files in one syep

* Use correct file name for wiki home page
  • Loading branch information
MarkZH authored Feb 16, 2024
1 parent b376ae3 commit 84108ea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 75 deletions.
41 changes: 1 addition & 40 deletions .github/workflows/sync-wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ on:
paths:
- 'wiki/**'
- 'README.md'
pull_request:
branches:
- master
paths:
- 'wiki/**'
- 'README.md'

jobs:
sync:
Expand All @@ -26,46 +20,13 @@ jobs:
with:
repository: "${{ github.repository }}.wiki"
path: "lichess-bot.wiki"
- name: Set path
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
wiki:
- 'wiki/**'
home:
- 'wiki/Home.md'
readme:
- 'README.md'
- name: Prevent Conflicts
if: |
steps.changes.outputs.home == 'true' &&
steps.changes.outputs.readme == 'true'
run: |
echo "Error: Conflicting changes. Edit either the README.md file or the wiki/Home.md file, not both."
exit 1
- name: Set github bot global config
if: github.event_name == "push"
run: |
git config --global user.email "[email protected]"
git config --global user.name "actions-user"
- name: Sync README.md to wiki/Home.md
if: steps.changes.outputs.readme == 'true' && github.event_name == "push"
run: |
cp -r $GITHUB_WORKSPACE/README.md $GITHUB_WORKSPACE/wiki/Home.md
git add wiki/Home.md
git commit -m "Auto update wiki/Home.md"
git push
- name: Sync wiki/Home.md to README.md
if: steps.changes.outputs.home == 'true' && github.event_name == "push"
run: |
cp -r $GITHUB_WORKSPACE/wiki/Home.md $GITHUB_WORKSPACE/README.md
git add README.md
git commit -m "Auto update README.md"
git push
- name: Sync all files to wiki
if: github.event_name == "push"
run: |
cp $GITHUB_WORKSPACE/README.md $GITHUB_WORKSPACE/lichess-bot.wiki/Home.md
cp -r $GITHUB_WORKSPACE/wiki/* $GITHUB_WORKSPACE/lichess-bot.wiki
cd $GITHUB_WORKSPACE/lichess-bot.wiki
git add .
Expand Down
35 changes: 0 additions & 35 deletions wiki/Home.md

This file was deleted.

0 comments on commit 84108ea

Please sign in to comment.