Skip to content

Commit

Permalink
Sync README.md to wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianPrieber committed Sep 24, 2024
1 parent 99de6a9 commit 110f188
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions .github/workflows/copy-readme-to-wiki.yml
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 "julian.prieber@llc.ovh"
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 "julian.prieber@llc.ovh"
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

0 comments on commit 110f188

Please sign in to comment.