-
-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (132 loc) · 5.31 KB
/
wiki-sync.yml
File metadata and controls
157 lines (132 loc) · 5.31 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Wiki Sync
# Triggers when PRs are merged to main (merge creates a push event to main)
# Also allows manual triggering via workflow_dispatch
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'README.md'
- '.github/CHANGELOG.md'
workflow_dispatch:
permissions:
contents: write
jobs:
sync-wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Sync core documentation to wiki
run: |
# Create wiki directory if it doesn't exist
mkdir -p wiki
# Sync key documentation files from docs/ to wiki/
# This ensures wiki stays in sync with main documentation
echo "Syncing documentation files to wiki..."
# Core files that should be synced
declare -A SYNC_MAP=(
["docs/README.md"]="wiki/Documentation-Index.md"
["docs/ARCHITECTURE.md"]="wiki/Architecture-Overview.md"
["docs/INSTALLATION.md"]="wiki/Installation-Guide.md"
["docs/USAGE.md"]="wiki/Usage-Guide.md"
["docs/TROUBLESHOOTING.md"]="wiki/Troubleshooting-Guide.md"
["docs/PERFORMANCE_TUNING.md"]="wiki/Performance-Tuning.md"
["docs/DISASTER_RECOVERY.md"]="wiki/Disaster-Recovery.md"
["docs/VAULT_SECURITY.md"]="wiki/Vault-Security.md"
["docs/SECURITY_ASSESSMENT.md"]="wiki/Security-Assessment.md"
["docs/TESTING_APPROACH.md"]="wiki/Testing-Approach.md"
["docs/SERVICE_CATALOG.md"]="wiki/Service-Catalog.md"
["docs/SERVICE_PROFILES.md"]="wiki/Service-Profiles.md"
["docs/UPGRADE_GUIDE.md"]="wiki/Upgrade-Guide.md"
["docs/ROLLBACK_PROCEDURES.md"]="wiki/Rollback-Procedures.md"
["README.md"]="wiki/Home.md"
[".github/CHANGELOG.md"]="wiki/Changelog.md"
)
SYNCED=0
SKIPPED=0
for src in "${!SYNC_MAP[@]}"; do
dest="${SYNC_MAP[$src]}"
if [ -f "$src" ]; then
# Check if files are different
if ! cmp -s "$src" "$dest" 2>/dev/null; then
echo " Syncing: $src → $dest"
cp "$src" "$dest"
((SYNCED++)) || true
else
echo " Unchanged: $dest"
((SKIPPED++)) || true
fi
else
echo " Warning: $src not found, skipping"
((SKIPPED++)) || true
fi
done
echo ""
echo "Sync complete:"
echo " - Synced: $SYNCED files"
echo " - Skipped: $SKIPPED files (unchanged or missing)"
- name: Check for changes
id: check_changes
run: |
if [[ -n $(git status wiki/ --porcelain) ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
echo "Wiki files have changes"
else
echo "changes=false" >> $GITHUB_OUTPUT
echo "No wiki changes detected"
fi
- name: Import GPG key for signing
if: steps.check_changes.outputs.changes == 'true'
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
continue-on-error: true
- name: Create Pull Request for wiki changes
if: steps.check_changes.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: |
docs: auto-sync documentation to wiki
Automated sync from main documentation to wiki directory.
This ensures wiki stays in sync with the main docs/ directory.
Files synced:
- docs/README.md → wiki/Documentation-Index.md
- docs/ARCHITECTURE.md → wiki/Architecture-Overview.md
- docs/SERVICE_CATALOG.md → wiki/Service-Catalog.md
- And other core documentation files
branch: wiki-sync-auto
delete-branch: true
title: 'docs: auto-sync documentation to wiki'
body: |
## Automated Wiki Sync
This PR automatically syncs changes from the main documentation to the wiki directory.
### Changes
- Synced updated documentation files from `docs/` to `wiki/`
- Ensures wiki stays consistent with main documentation
### Files Updated
- Documentation Index
- Architecture Overview
- Service Catalog
- Other core documentation files
**Note**: This is an automated PR created by the Wiki Sync workflow.
labels: documentation, automated
signoff: true
- name: Summary
if: steps.check_changes.outputs.changes == 'true'
run: |
echo "✅ Wiki sync PR created successfully"
- name: No changes summary
if: steps.check_changes.outputs.changes == 'false'
run: |
echo "ℹ️ Wiki already in sync with main documentation"