Skip to content

Generate and Publish Stats #262

Generate and Publish Stats

Generate and Publish Stats #262

Workflow file for this run

name: Generate and Publish Stats
on:
push:
branches:
- main
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
jobs:
generate-and-publish-stats:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.FPF_BRANCH_UPDATER_APP_ID }}
private-key: ${{ secrets.FPF_BRANCH_UPDATER_APP_PRIVKEY }}
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false
- name: Set some local git configs
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v6
- name: Generate stats
run: uv run generate_stats.py
- name: Publish to gh-pages
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
uv tool run ghp-import@2.1.0 \
--no-jekyll \
--cname stats.dangerzone.rocks \
--no-history \
--push \
output