Giter Club home page Giter Club logo

github-stats's Introduction

github-stats (template)

This is a GitHub template that contains a working Action workflow to deploy static pages containing GitHub stats as GitHub Pages using github-stats-pages

The full documentation and guide is available with github-stats-pages. However, to make it easier, we provide pertinent details below:

TL;DR

For easy deployment, try this GitHub template. Simply:

  1. Use it!
  2. Add a Personal access token, as a repository secret, GH_TOKEN. See above (Settings > Secrets)
  3. Enable GitHub Actions (Settings > Actions)
  4. Enable GitHub pages through the settings page and select gh-pages (Settings > Pages)
  5. Sit back and enjoy that โ˜•๏ธ!

The Nitty Gritty

GitHub Pages deployment is simple with the following GitHub Actions workflow:

  - name: Checkout
    uses: actions/checkout@v2
  - name: Get current date
    id: date
    run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
  - name: Build GitHub stats pages
    uses: astrochun/github-stats-pages@latest
    with:
      username: ${{ github.repository_owner }}
      token: ${{ secrets.GH_TOKEN }}
  - name: Upload data to main branch
    uses: EndBug/[email protected]
    with:
      add: 'data'
      branch: main
      message: "Update data: ${{ steps.date.outputs.date }}"
      author_name: 'github-actions[bot]'
      author_email: '41898282+github-actions[bot]@users.noreply.github.com'
  - name: Upload static files to gh-pages
    uses: peaceiris/actions-gh-pages@v3
    with:
      personal_token: ${{ secrets.GH_TOKEN }}
      publish_dir: ./public
      keep_files: false
      user_name: 'github-actions[bot]'
      user_email: '41898282+github-actions[bot]@users.noreply.github.com'
      publish_branch: gh-pages
      commit_message: "Update static pages: ${{ steps.date.outputs.date }}"

This workflow will run for all public repositories.

Inputs
Variable Description Required? Type Defaults Examples
username GitHub username or organization Yes str N/A astrochun
token GitHub Personal Access Token (PAT) Yes str N/A abcdef12345678
include-repos Comma-separated lists of repositories. This overrides the full list of public repositories No str '' 'github-stats-pages,astrochun.github.io'
exclude-repos Comma-separated lists of repositories to exclude from default public repository list No str '' 'repo1'
Other GitHub Action deployment examples:

To override all public repositories and limit to a subset of public repositories, specify a comma-separated list (no spaces between commas) for include-repos argument.

  - name: Build GitHub stats pages
    uses: astrochun/github-stats-pages@latest
    with:
      username: ${{ github.repository_owner }}
      token: ${{ secrets.GH_TOKEN }}
      include-repos: "github-stats-pages"

Alternatively to exclude specific repositories from the list of public repositories, use the exclude-repos argument with a comma-separated list (no spaces between commas).

  - name: Build GitHub stats pages
    uses: astrochun/github-stats-pages@latest
    with:
      username: ${{ github.repository_owner }}
      token: ${{ secrets.GH_TOKEN }}
      exclude-repos: "repo1,repo2"

Note that you can only specify include-repos or exclude-repos. Specifying both will fail!

github-stats's People

Contributors

astrochun avatar github-actions[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.