Skip to content

Commit 675b036

Browse files
Copilotneilime
andcommitted
refactor: remove pull mode, keep only push mode for real-time sync
Co-authored-by: neilime <314088+neilime@users.noreply.github.com>
1 parent 7cdd735 commit 675b036

File tree

9 files changed

+140
-1018
lines changed

9 files changed

+140
-1018
lines changed

.github/EXAMPLES.md

Lines changed: 24 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,12 @@
11
# Documentation Aggregation - Usage Examples
22

3-
This document provides examples of how to use the documentation aggregation system in both pull and push modes.
4-
5-
## Pull Mode Examples
6-
7-
These examples are for the `.github/docs-sources.yml` configuration file.
8-
9-
### Example 1: Basic Configuration
10-
11-
Add a simple repository with documentation in a `docs/` folder:
12-
13-
```yaml
14-
repositories:
15-
- repository: my-project
16-
enabled: true
17-
docs_path: docs
18-
target_path: projects/my-project
19-
branch: main
20-
description: My awesome project
21-
```
22-
23-
## Example 2: README Only
24-
25-
Pull only the README.md from a repository:
26-
27-
```yaml
28-
repositories:
29-
- repository: simple-tool
30-
enabled: true
31-
files:
32-
- README.md
33-
target_path: projects/simple-tool
34-
branch: main
35-
description: A simple tool
36-
```
37-
38-
## Example 3: Custom Documentation Path
39-
40-
If your documentation is in a non-standard location:
41-
42-
```yaml
43-
repositories:
44-
- repository: custom-project
45-
enabled: true
46-
docs_path: documentation
47-
target_path: projects/custom-project
48-
branch: develop
49-
description: Project with custom docs path
50-
```
51-
52-
## Example 4: With Exclusions
53-
54-
Exclude certain files or patterns:
55-
56-
```yaml
57-
repositories:
58-
- repository: big-project
59-
enabled: true
60-
docs_path: docs
61-
target_path: projects/big-project
62-
exclude:
63-
- "*.draft.md"
64-
- "internal/**"
65-
- "wip-*.md"
66-
description: Big project with internal docs
67-
```
68-
69-
## Example 5: Multiple Specific Files
70-
71-
Pull multiple specific files:
72-
73-
```yaml
74-
repositories:
75-
- repository: api-project
76-
enabled: true
77-
files:
78-
- README.md
79-
- docs/api-reference.md
80-
- docs/getting-started.md
81-
target_path: projects/api-project
82-
branch: main
83-
description: API project with specific docs
84-
```
3+
This document provides examples of how to use the push-based documentation aggregation system.
854

865
## Push Mode Examples
876

887
These examples are for workflows in **project repositories** that push their documentation to public-docs.
898

90-
### Example 6: Basic Push Mode
9+
### Example 1: Basic Push Mode
9110

9211
Minimal configuration for pushing documentation on every commit:
9312

@@ -113,7 +32,7 @@ jobs:
11332
PUBLIC_DOCS_TOKEN: ${{ secrets.PUBLIC_DOCS_TOKEN }}
11433
```
11534
116-
### Example 7: Push with Custom Docs Path
35+
### Example 2: Push with Custom Docs Path
11736
11837
If your documentation is in a non-standard location:
11938
@@ -130,7 +49,7 @@ jobs:
13049
PUBLIC_DOCS_TOKEN: ${{ secrets.PUBLIC_DOCS_TOKEN }}
13150
```
13251
133-
### Example 8: Push from Multiple Branches
52+
### Example 3: Push from Multiple Branches
13453
13554
Sync documentation from both main and develop branches:
13655
@@ -166,73 +85,42 @@ jobs:
16685
PUBLIC_DOCS_TOKEN: ${{ secrets.PUBLIC_DOCS_TOKEN }}
16786
```
16887
169-
### Example 9: Combined Pull and Push
170-
171-
Use both modes for redundancy and verification:
172-
173-
1. **In project repository** - Add push workflow for immediate updates
174-
2. **In public-docs** - Keep pull configuration as backup
175-
176-
This ensures documentation is always up-to-date with push mode, while pull mode serves as a scheduled verification.
177-
178-
## Testing Locally
179-
180-
### Testing Pull Mode
181-
182-
```bash
183-
# Set your GitHub token
184-
export GITHUB_TOKEN="your_token_here"
185-
186-
# Pull documentation
187-
cd application
188-
npm run pull-docs
189-
190-
# View the results
191-
ls -la docs/projects/
192-
193-
# Build to test
194-
npm run build
195-
```
196-
197-
### Testing Push Mode
88+
## Testing
19889
199-
Push mode can only be tested by:
90+
Push mode can be tested by:
20091
1. Setting up the workflow in your project repository
20192
2. Adding the `PUBLIC_DOCS_TOKEN` secret
20293
3. Making a commit to `docs/**` or `README.md`
20394
4. Checking the Actions tab for workflow execution
95+
5. Verifying the documentation appears in the portal
20496

20597
## Troubleshooting
20698

207-
### Repository not found
208-
209-
```
210-
❌ Failed to pull from my-project: Not Found
211-
```
99+
### Workflow not triggering
212100

213101
**Solution**: Check that:
214-
1. The repository exists in the hoverkraft-tech organization
215-
2. Your GitHub token has access to read the repository
216-
3. The repository name is spelled correctly
102+
1. The workflow file is in `.github/workflows/` directory
103+
2. The paths match your documentation structure
104+
3. You're pushing to the correct branch
105+
4. The workflow has no syntax errors
217106

218-
### Documentation path not found
107+
### Token permission errors
219108

220109
```
221-
⚠️ Path not found: my-project/docs
110+
❌ Permission denied
222111
```
223112
224113
**Solution**: Check that:
225-
1. The `docs_path` matches the actual directory in the repository
226-
2. The branch specified exists
227-
3. The directory contains files (not empty)
228-
229-
### File size limit exceeded
114+
1. `PUBLIC_DOCS_TOKEN` secret is configured in your project repository
115+
2. The token has `contents: write` permission for public-docs repository
116+
3. The token hasn't expired
230117
231-
```
232-
⚠️ Skipping large-file.md (exceeds max size: 2048000 bytes)
118+
### Documentation not appearing
233119
```
234120

235-
**Solution**: Either:
236-
1. Increase `max_file_size` in settings
237-
2. Split the large file into smaller files
238-
3. Exclude the large file and link to it in GitHub instead
121+
**Solution**: Check that:
122+
1. The workflow executed successfully (check Actions tab in project repo)
123+
2. The `target_path` is correct
124+
3. The documentation files are `.md` or `.mdx`
125+
4. The public-docs repository was updated (check recent commits)
126+
5. The portal was rebuilt and deployed

0 commit comments

Comments
 (0)