Delete Cache & Backfill #3
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: Delete Cache & Backfill | |
on: | |
- workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
cache: 'poetry' | |
- name: Install pip Dependencies | |
working-directory: chatdownloader/ | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
- name: Delete old cache | |
env: | |
CACHE_NAME: ${{ hashFiles('season.txt') }} | |
REPO: ${{ github.repository }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if [ "${ACT}" == "1" ]; then | |
echo "On Act, skipping." | |
exit 0 | |
fi | |
echo "Deleting old cache" | |
gh extension install actions/gh-actions-cache | |
gh actions-cache delete ${CACHE_NAME} -R $REPO --confirm || exit 0 | |
- name: Run backfill | |
env: | |
ACT: ${{ vars.ACT }} | |
TWITCH_APPID: ${{ secrets.TWITCH_APPID }} | |
TWITCH_APPSECRET: ${{ secrets.TWITCH_APPSECRET }} | |
working-directory: chatdownloader/ | |
run: | | |
echo "On Act, backfilling instead." | |
python src/backfill.py | |
- name: Stage files | |
run: | | |
./stage.sh | |
- name: Save leaderboards to cache | |
uses: actions/cache/save@v3 | |
with: | |
path: | | |
chatdownloader/*.json | |
key: ${{ hashFiles('season.txt') }} |