ci: add wiki documentation sync
Some checks failed
Update Wiki Documentation / generate-docs (push) Failing after 1m59s
Some checks failed
Update Wiki Documentation / generate-docs (push) Failing after 1m59s
This commit is contained in:
45
.gitea/workflows/documentation.yml
Normal file
45
.gitea/workflows/documentation.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Update Wiki Documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
generate-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Build Markdown Docs
|
||||
run: |
|
||||
chmod +x gradlew
|
||||
./gradlew dokkaGfm
|
||||
|
||||
- name: Sync to Wiki
|
||||
run: |
|
||||
git config --global user.name "Gitea Bot"
|
||||
git config --global user.email "bot@gitea.io"
|
||||
|
||||
WIKI_URL="https://${{ gitea.token }}@gitea.archvium.eu/KrzysztofC/Retro_HA.wiki.git"
|
||||
|
||||
git clone "$WIKI_URL" wiki_dir
|
||||
|
||||
rm -rf wiki_dir/*
|
||||
cp -r docs/wiki/gfm/* wiki_dir/
|
||||
|
||||
cd wiki_dir
|
||||
git add .
|
||||
if ! git diff --cached --quiet; then
|
||||
git commit -m "Auto-update wiki from CI/CD"
|
||||
git push origin master
|
||||
else
|
||||
echo "No changes to sync."
|
||||
fi
|
||||
Reference in New Issue
Block a user