File tree Expand file tree Collapse file tree 1 file changed +70
-0
lines changed
Expand file tree Collapse file tree 1 file changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Monitor GitHub Followers
2+ on :
3+ schedule :
4+ - cron : ' 0 */6 * * *' # Every 6 hours
5+ workflow_dispatch : # Manual trigger
6+ push :
7+ branches : [ main ]
8+
9+ permissions :
10+ contents : write
11+ pages : write
12+ id-token : write
13+
14+ concurrency :
15+ group : " pages"
16+ cancel-in-progress : false
17+
18+ jobs :
19+ monitor-followers :
20+ runs-on : ubuntu-latest
21+ steps :
22+ - name : Checkout repository
23+ uses : actions/checkout@v4
24+ with :
25+ fetch-depth : 0
26+
27+ - name : Setup Node.js
28+ uses : actions/setup-node@v4
29+ with :
30+ node-version : ' 18'
31+
32+ - name : Monitor followers and update data
33+ env :
34+ TOKEN : ${{ secrets.TOKEN }}
35+ GITHUB_USERNAME : ${{ github.repository_owner }}
36+ run : |
37+ node scripts/monitor.js
38+
39+ - name : Commit and push changes
40+ run : |
41+ git config --local user.email "action@github.com"
42+ git config --local user.name "GitHub Action"
43+ git add data/
44+ if git diff --staged --quiet; then
45+ echo "No changes to commit"
46+ else
47+ git commit -m "Update follower data - $(date)"
48+ git push
49+ fi
50+
51+ deploy :
52+ needs : monitor-followers
53+ runs-on : ubuntu-latest
54+ steps :
55+ - name : Checkout
56+ uses : actions/checkout@v4
57+ with :
58+ ref : main
59+
60+ - name : Setup Pages
61+ uses : actions/configure-pages@v4
62+
63+ - name : Upload artifact
64+ uses : actions/upload-pages-artifact@v3
65+ with :
66+ path : ' ./dashboard'
67+
68+ - name : Deploy to GitHub Pages
69+ id : deployment
70+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments