forked from chce/aoc2021-nc-scoreboard
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (40 loc) · 1.26 KB
/
main.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
name: Update Scores
on:
push:
branches:
- master
schedule:
- cron: '30 5,6,7,11,15 * 12 *'
jobs:
update-scores:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Fetch Scores
uses: JamesIves/fetch-api-data-action@v2
with:
endpoint: https://adventofcode.com/2023/leaderboard/private/view/2252784.json
configuration: '{ "method": "GET", "headers": {"cookie": "session=${{ secrets.SESSION_COOKIE }}", "User-Agent": "https://github.com/Netcompany-AoC-DK/aoc-nc-scoreboard by tfe@netcompany.com and chce@netcompany.com"} }'
debug: true
- name: LSTwo
run: |
ls
- name: Overwrite scores.json
uses: DamianReeves/write-file-action@master
with:
path: ./src/scores.json
contents: ${{env.fetchApiData}}
write-mode: overwrite
- name: Install dependencies
run: |
npm i
npm run build
- name: Deploy with gh-pages
run: |
ls
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
ls
npm run deploy-gh-action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}