Leaderboard #8953
This file contains hidden or 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
| # Will post the leaderboard results to AoC discord | |
| name: Leaderboard | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # Run this first one below during december | |
| # every hour 9am CST to 11pm CST | |
| - cron: '0 15-23,0-5 * * *' | |
| # 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: ${{ secrets.DISCORD_URL }} | |
| # NUM_STARS_TO_PRINT: 2 | |
| LEADER_STATE_DIR: ${{ github.workspace }} | |
| run: | | |
| cd main | |
| go run ./tools/leader | |
| - 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 |