Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

11 Commits

Repository files navigation

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: Checkoutuses: actions/checkout@v2
- name: Get current dateid: daterun: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Build GitHub stats pagesuses: astrochun/github-stats-pages@latestwith:
username: ${{ github.repository_owner }}token: ${{ secrets.GH_TOKEN }}
- name: Upload data to main branchuses: EndBug/add-and-commit@v7.0.0with:
add: 'data'branch: mainmessage: "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-pagesuses: peaceiris/actions-gh-pages@v3with:
personal_token: ${{ secrets.GH_TOKEN }}publish_dir: ./publickeep_files: falseuser_name: 'github-actions[bot]'user_email: '41898282+github-actions[bot]@users.noreply.github.com'publish_branch: gh-pagescommit_message: "Update static pages: ${{ steps.date.outputs.date }}"

This workflow will run for all public repositories.

Inputs
VariableDescriptionRequired?TypeDefaultsExamples
usernameGitHub username or organizationYesstrN/Aastrochun
tokenGitHub Personal Access Token (PAT)YesstrN/Aabcdef12345678
include-reposComma-separated lists of repositories. This overrides the full list of public repositoriesNostr'''github-stats-pages,astrochun.github.io'
exclude-reposComma-separated lists of repositories to exclude from default public repository listNostr'''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 pagesuses: astrochun/github-stats-pages@latestwith:
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 pagesuses: astrochun/github-stats-pages@latestwith:
username: ${{ github.repository_owner }}token: ${{ secrets.GH_TOKEN }}exclude-repos: "repo1,repo2"

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