Update Scores #557
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/2024/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 }} | |