A probably over-engineered project to show some statistics using data pulled from the GitHub API :)
- Simple setup
- Automated front-end generation
- Automatic management of GitHub data and view data (initial downloading and updating are handled for you!)
GHstats supports these "views" at the moment:
issue-countspull-countsissue-deltasissue-closers
-
Clone this repository with only the
mainbranchgit clone https://github.com/ichard26/ghstats.git --single-branch
-
Run
nox -s run-ghstats -R -- setupand follow/answer the prompts$ nox -s run-ghstats -R -- setup nox > Running session run-ghstats nox > Creating virtual environment (virtualenv) using python in .nox/run-ghstats nox > python -m pip install attrs click colorama jinja2 nox > python -m scripts.ghstats setup [ghstats] Deleted web directory. Instance title: Richard's GHstats instance Instance repository name (used to set up relative URLs): ghstats GitHub username (used in user-agent + footer): ichard26 [ghstats] Configuration saved! Would you like to add a repository to your instance? [Y/n]: y Repository ($owner/$name): psf/black Add 'issue-counts' (open issues over time) view? [Y/n]: y Add 'pull-counts' (open pull requests over time) view? [Y/n]: y Add 'issue-deltas' (monthly delta of open issues over time) view? [Y/n]: y Add 'issue-closers' (number of issues closed by collaborators over time) view? [Y/n]: y [ghstats] Added 'psf/black' to configuration. [ghstats] Wrote index page. [ghstats] Wrote HTML for 'psf/black'. [ghstats] Wrote Vite build configuration. [ghstats] Copied static assets. Web directory is ready! nox > Session run-ghstats was successful.
-
If you'd like to track stats for another repository, you can run
nox -s run-ghstats -- add-repositoryYou can repeat this step to add as many repositories as you want (although if you add too many repositories at once, the
Refresh assetsGHA workflow may run API rate limits). -
Stage and commit the new/updated files and directories:
config.jsonandweb/
- Create a new repository on GitHub and push your local Git repository to it (manually
or using
gh) - Either locally or via the GitHub web interface, create a new branch called
production - Go into your repository settings under the
Pagestab and ...- Set
SourcetoDeploy from a branch - Set
Branchtoproduction
- Set
- Trigger a new run of the
Refresh assetsGHA workflow from theActionstab - Observe
productionbeing updated and your new instance being deployed to GitHub Pages ...
If the website is up and looks good, congrats! You've set up your own instance. It shouldn't require any maintenance on your part from now on. The workflow will automatically run every day and push updates as needed.
Note: the Refresh assets workflow will probably fail after step one since the
production branch doesn't exist yet, just ignore the first failure.