File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Update Stats
2
+
3
+ on :
4
+ schedule :
5
+ - cron : ' 0 0 * * *' # Runs every day at midnight UTC
6
+ workflow_dispatch : # Allows manual triggering
7
+
8
+ permissions :
9
+ contents : write # Required to push updates to gh-pages
10
+
11
+ jobs :
12
+ update-stats :
13
+ runs-on : ubuntu-latest
14
+
15
+ steps :
16
+ - name : Checkout repository
17
+ uses : actions/checkout@v4
18
+
19
+ - name : Run stats script
20
+ env :
21
+ STEAM_ID : ${{ secrets.STEAM_ID }}
22
+ STEAM_API_KEY : ${{ secrets.STEAM_API_KEY }}
23
+ DISCORD_ID : ${{ secrets.DISCORD_ID }}
24
+ DISCORD_BOT_KEY : ${{ secrets.DISCORD_BOT_KEY }}
25
+ GIT_API_KEY : ${{ secrets.GIT_API_KEY }}
26
+ run : |
27
+ chmod +x setup-stats.sh
28
+ ./setup-stats.sh
29
+
30
+ - name : Checkout gh-pages branch
31
+ uses : actions/checkout@v4
32
+ with :
33
+ ref : gh-pages
34
+ path : gh-pages
35
+
36
+ - name : Copy stats file to gh-pages
37
+ run : |
38
+ mv stats.json gh-pages/src/assets/stats.json
39
+ cd gh-pages
40
+ git config --global user.name "github-actions[bot]"
41
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
42
+ git add src/assets/stats.json
43
+ git commit -m "Update stats.json" || echo "No changes to commit"
44
+ git push
You can’t perform that action at this time.
0 commit comments