-
-
Notifications
You must be signed in to change notification settings - Fork 11
108 lines (94 loc) · 3.44 KB
/
update-docs.yml
File metadata and controls
108 lines (94 loc) · 3.44 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
name: 📄 Update readme
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *" # 06:00 UTC daily
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: "scripts/requirements.txt"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt
# 1) Fetch framework stats (uses token for GitHub/NPM requests)
- name: Fetch framework stats
id: fetch
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYTHONPATH: ${{ github.workspace }}:${{ github.workspace }}/scripts
run: |
python scripts/transform/fetch_framework_stats.py
# 2) Insert stats table into README
- name: Insert stats table
id: insert_table
continue-on-error: true
run: |
python scripts/transform/insert_framework_stats.py
# 3) Insert status badges into README
- name: Insert status badges
id: insert_statuses
continue-on-error: true
run: |
python scripts/transform/insert_statuses.py
# 4) Update project READMEs
- name: Build app READMEs
id: build_readmes
continue-on-error: true
run: |
python scripts/transform/build_app_readme.py
# 5) Build charts and update README with QuickChart.io URLs
- name: Build charts
id: build_charts
continue-on-error: true
run: |
python scripts/transform/build_charts.py
- name: Commit & push changes (if any)
if: always()
env:
TOKEN: ${{ secrets.BOT_TOKEN != '' && secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
GIT_AUTHOR_NAME: liss-bot
GIT_AUTHOR_EMAIL: alicia-gh-bot@mail.as93.net
run: |
git config user.name "$GIT_AUTHOR_NAME"
git config user.email "$GIT_AUTHOR_EMAIL"
git add -A
if git diff --staged --quiet; then
echo "No changes to commit."
exit 0
fi
git commit -m "chore: update framework stats and READMEs [skip ci]"
git remote set-url origin "https://x-access-token:${TOKEN}@github.com/${{ github.repository }}.git"
git push origin HEAD:main
- name: Summary
if: always()
run: |
fetch="${{ steps.fetch.conclusion }}"
insert_table="${{ steps.insert_table.conclusion }}"
insert_statuses="${{ steps.insert_statuses.conclusion }}"
build_readmes="${{ steps.build_readmes.conclusion }}"
build_charts="${{ steps.build_charts.conclusion }}"
line() {
if [ "$1" = "success" ]; then echo "- ✅ $2"; else echo "- ❌ $2"; fi
}
{
line "$fetch" "Fetched framework stats"
line "$insert_table" "Inserted stats table into readme"
line "$insert_statuses" "Inserted status badges into readme"
line "$build_readmes" "Updated project readmes"
line "$build_charts" "Built charts and updated readme"
} >> "$GITHUB_STEP_SUMMARY"