Skip to content

adamws/github-pages-generator

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

GitHub pages generator

Generate and deploy minimalistic website with your repositories statistics with GitHub Actions.

Key features:

  • lightweight, html and css only
  • responsive, mobile friendly
  • customizable and extensible

Example workflow

  • To run and deploy at 12:00pm every day:

    name: Build and deploy website
    
    on:
      push:
        branches:
          - master
      schedule:
        - cron: "0 12 * * *"
    
    jobs:
      build:
        runs-on: ubuntu-latest
        steps:
        - name: Build
          uses: adamws/github-pages-generator@master
          with:
            github_token: ${{ secrets.GITHUB_TOKEN }}
            username: ${{ github.actor }}
            output_dir: ./output
        - name: Deploy
          uses: peaceiris/actions-gh-pages@v3
          with:
            github_token: ${{ secrets.GITHUB_TOKEN }}
            publish_branch: gh-pages
            publish_dir: ./output
  • To run in data-only mode for creating repositories.json file at output_dir path, which can be used for integration with other tools:

    jobs:
      build:
        runs-on: ubuntu-latest
        steps:
        - name: Get data
          uses: adamws/github-pages-generator@master
          with:
            github_token: ${{ secrets.GITHUB_TOKEN }}
            username: ${{ github.actor }}
            data_only: true
  • Other examples:

    assets/screenshot.png

Local usage

Clone this repository, install dependencies, build and serve:

git clone https://github.com/adamws/github-pages-generator.git && cd github-pages-generator
python -m venv .env
source .env/bin/activate
pip install -r requirements.txt
python github-pages-generator/build.py --username <<github username>>
cd output
python -m http.server

After that, open http://0.0.0.0:8000/ in browser. Files from output directory can be manually committed to gh-pages branch or your GitHub Pages repository, but it is recommended to set up automatic deployment with GitHub Actions which will trigger periodically, keeping your statistics up to date.

Rate limits

GitHub's REST API has rate limits which can be easily reached while experimenting with this tool. There are two mechanisms built-in to circumvent that: