Update Download Stats #117
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: Update Download Stats | |
| on: | |
| schedule: | |
| - cron: "0 6 * * *" # Daily at 6 AM UTC | |
| workflow_dispatch: | |
| jobs: | |
| update-stats: | |
| if: github.repository == 'barebaric/rayforge' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Install snapcraft | |
| run: sudo snap install snapcraft --classic | |
| - name: Fetch and push stats to VictoriaMetrics | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: /tmp/snapcraft-creds.txt | |
| METRICS_URL: ${{ secrets.METRICS_URL }} | |
| METRICS_API_USER: ${{ secrets.METRICS_API_USER }} | |
| METRICS_API_PASSWORD: ${{ secrets.METRICS_API_PASSWORD }} | |
| run: | | |
| echo "${{ secrets.STORE_LOGIN }}" > /tmp/snapcraft-creds.txt | |
| python3 scripts/fetch_download_stats.py --output metrics | |
| rm -f /tmp/snapcraft-creds.txt |