Skip to content

Leaderboard

Leaderboard #8966

Workflow file for this run

# Will post the leaderboard results to AoC discord
name: Leaderboard
on:
workflow_dispatch:
inputs:
force:
description: 'Force refresh of cache'
required: false
default: false
type: boolean
discord_target:
description: 'Discord server to post to'
required: false
default: 'aoc'
type: choice
options:
- aoc
- cachie server
schedule:
# Run this first one below during december
# every hour 9am CST to 11pm CST
- cron: '0 15-23,0-5 * 12 *'
# 9am (UTC = 3pm or 15 hundred o'clock)
# - cron: '0 15 * * *'
# 9pm (UTC = 3am or 03 hundred o'clock)
# - cron: '0 3 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: 'master'
path: 'main'
- uses: actions/checkout@v3
with:
ref: 'state'
path: '.state'
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Build
env:
LEADER_URL: ${{ secrets.LEADER_URL }}
SESSION_COOKIE: ${{ secrets.SESSION_COOKIE }}
DISCORD_URL: ${{ inputs.discord_target == 'cachie server' && secrets.DISCORD_URL_CACHIE_SERVER || secrets.DISCORD_URL }}
# NUM_STARS_TO_PRINT: 2
LEADER_STATE_DIR: ${{ github.workspace }}
run: |
cd main
go run ./tools/leader ${{ inputs.force && 'force' || '' }}
- name: Persist State
run: |
cd .state
if [[ `git status --porcelain` ]]; then
git config --global user.name 'davidwashere'
git config --global user.email '[email protected]'
git add . && git commit -m "automatic state update" && git push -u origin state
fi