-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.26 KB
/
blank.yml
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
# GitHub Actions to generate lichess-stats.json dynamically every day
name: run-script
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "5 0 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Testing GitHub Actions Status
run: echo Hello, world!
- name: Getting data from lichess API
run: |
sudo apt install curl
curl https://lichess.org/api/account -H "Authorization: Bearer ${{ secrets.LICHESS_TOKEN }}" >> _data/lichess-stats.json
- name: Committing to the repo
run: |
git config --global user.name "jishanshaikh4/lichess-stats"
git config --global user.email "lichess-stats[bot]@jishan.github.io"
git add .
# "echo" returns true so the build succeeds, even if no changed files
git commit -m 'feat: added lichess-stats.json via api' || echo
git push
#- run: |
# make file runnable, might not be necessary
#chmod +x "${GITHUB_WORKSPACE}/test.sh"
# run script
#".github/test.sh"
# or
#"${{ format('{0}/test.sh', github.workspace) }}"
timeout-minutes: 30