Routine Data Cache Request #911
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
| name: Routine Data Cache Request | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '45 8 * * *' | |
| concurrency: | |
| group: data-cache | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| TAG: CACHE | |
| jobs: | |
| runDataUpdate: | |
| name: Run Cache Request | |
| runs-on: ubuntu-latest | |
| env: | |
| REPO_DIR: main | |
| TIMESTAMP: X | |
| steps: | |
| - name: Store timestamp | |
| run: | | |
| echo "TIMESTAMP=$(date -u +"%F-%H")" >> "$GITHUB_ENV" | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| path: ${{ env.REPO_DIR }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| cache-dependency-path: '${{ env.REPO_DIR }}/_visualize/scripts/requirements.txt' | |
| - name: Install dependencies | |
| run: pip install -r $REPO_DIR/_visualize/scripts/requirements.txt | |
| - name: Run data collection script | |
| run: | | |
| set -eu | |
| cd $REPO_DIR/_visualize/scripts | |
| ./UPDATE.sh $TAG | |
| env: | |
| GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Show health stats | |
| if: ${{ always() }} | |
| run: | | |
| cat $REPO_DIR/_visualize/LAST_${TAG}_UPDATE.txt || true | |
| echo "Warning Count: $(grep -c 'Warning' $REPO_DIR/_visualize/LAST_${TAG}_UPDATE.log)" | |
| echo "From Timeouts: $(grep -c 'but failed' $REPO_DIR/_visualize/LAST_${TAG}_UPDATE.log)" | |
| echo "Limit Reached: $(grep -c 'rate limit exceeded' $REPO_DIR/_visualize/LAST_${TAG}_UPDATE.log)" | |
| - name: Save log files | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: logfiles_${{ env.TIMESTAMP }}_cache | |
| path: | | |
| ${{ env.REPO_DIR }}/_visualize/LAST_${{ env.TAG }}_UPDATE.txt | |
| ${{ env.REPO_DIR }}/_visualize/LAST_${{ env.TAG }}_UPDATE.log |