-
Notifications
You must be signed in to change notification settings - Fork 8
57 lines (48 loc) · 1.72 KB
/
update_wiki.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Update Wiki
on:
push:
branches:
- main
jobs:
update-wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Clone Wiki Repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git wiki
continue-on-error: true
- name: Remove Old Wiki Content
run: |
echo "Removing old wiki content..."
rm -rf wiki/*
- name: Copy Files to Wiki
run: |
echo "Copying files..."
cp -r docs/* wiki/
ls -la wiki # List files to verify copying
- name: Create Custom Sidebar
run: |
echo "Creating custom sidebar..."
echo "# Sidebar" > wiki/_Sidebar.md
echo "* [Introduction](Introduction.md)" >> wiki/_Sidebar.md
echo "* [Configurations](Configurations.md)" >> wiki/_Sidebar.md
echo "* [SETUP and Installation](SETUP-and-Installation.md)" >> wiki/_Sidebar.md
echo "* [FAQ](FAQ.md)" >> wiki/_Sidebar.md
cat wiki/_Sidebar.md # Output the updated _Sidebar.md
- name: Commit and Push Changes to Wiki
run: |
cd wiki
git add .
git commit -m "Update wiki content and custom sidebar" || echo "No changes to commit"
git push
continue-on-error: true
- name: List files in wiki directory after push
run: ls -la wiki