-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (122 loc) Β· 5.01 KB
/
update-docs.yml
File metadata and controls
141 lines (122 loc) Β· 5.01 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
name: Update Documentation
on:
schedule:
# Run daily at 6 AM UTC
- cron: "0 6 * * *"
workflow_dispatch:
# Allow manual triggering
push:
branches: [main]
paths:
- ".github/scripts/generate-docs.js"
- ".github/workflows/update-docs.yml"
concurrency:
group: update-docs
cancel-in-progress: false
jobs:
update-docs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Generate documentation from repositories
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "π Starting documentation generation..."
npm run generate-docs
working-directory: ./application
- name: Check for changes
id: changes
run: |
if git diff --quiet; then
echo "changed=false" >> $GITHUB_OUTPUT
echo "π No changes detected"
else
echo "changed=true" >> $GITHUB_OUTPUT
echo "π Changes detected"
git diff --name-only
fi
- name: Create Pull Request
if: steps.changes.outputs.changed == 'true' && github.event_name == 'schedule'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: update repository data from GitHub API"
title: "π€ Update repository documentation"
body: |
## π€ Automated Documentation Update
This PR was automatically generated to update the documentation with the latest repository information from the Hoverkraft GitHub organization.
### Changes
- Updated project listings with current repository data
- Refreshed repository statistics (stars, languages, topics)
- Updated last modified dates
- Categorized projects based on latest topics and descriptions
### Generated Files
- `docs/projects.md` - Updated project catalog
- `docs/projects.module.css` - Updated styling
- `src/pages/index.tsx` - Updated homepage with featured projects
This update includes data from **all public repositories** in the [@hoverkraft-tech](https://github.com/hoverkraft-tech) organization.
---
π **Generated**: $(date)
π **Triggered**: Daily automation
π **Source**: GitHub API
branch: update-docs-${{ github.run_number }}
branch-suffix: timestamp
delete-branch: true
- name: Auto-commit changes (on push to main)
if: steps.changes.outputs.changed == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "docs: update repository data from GitHub API [skip ci]"
git push
- name: Build documentation
run: |
echo "ποΈ Building documentation..."
npm run build
echo "β
Documentation built successfully"
- name: Deploy to GitHub Pages (on main branch)
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
commit_message: "deploy: update GitHub Pages [skip ci]"
- name: Summary
run: |
echo "## π Documentation Update Summary" >> $GITHUB_STEP_SUMMARY
echo "- **Repository scan**: β
Completed" >> $GITHUB_STEP_SUMMARY
echo "- **Documentation generation**: β
Completed" >> $GITHUB_STEP_SUMMARY
echo "- **Build**: β
Completed" >> $GITHUB_STEP_SUMMARY
if [[ "${{ steps.changes.outputs.changed }}" == "true" ]]; then
echo "- **Changes detected**: β
Yes" >> $GITHUB_STEP_SUMMARY
if [[ "${{ github.event_name }}" == "schedule" ]]; then
echo "- **Pull request**: β
Created" >> $GITHUB_STEP_SUMMARY
else
echo "- **Auto-commit**: β
Applied" >> $GITHUB_STEP_SUMMARY
fi
else
echo "- **Changes detected**: β No" >> $GITHUB_STEP_SUMMARY
fi
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "- **Deployment**: β
Completed to GitHub Pages" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "π **Live site**: [docs.hoverkraft.cloud](https://docs.hoverkraft.cloud)" >> $GITHUB_STEP_SUMMARY