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:
For easy deployment, try this GitHub template. Simply:
- Use it!
- Add a Personal access token, as a repository secret,
GH_TOKEN. See above (Settings > Secrets) - Enable GitHub Actions (Settings > Actions)
- Enable GitHub pages through the settings page and select
gh-pages(Settings > Pages) - Sit back and enjoy that ☕️!
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.
| 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' |
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!