Skip to content

tsunematsu21/actions-publish-gh-pages

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

Publish to GitHub Pages 🍣

GitHub release (latest by date including pre-releases) GitHub

A GitHub Action to publish static website using GitHub Pages.
This Action provides publish arbitrary directory that contains static content in your workflow to the GitHub Pages.

Usage

Inputs

  • dir - The directory that containing the content to be published. Can be specified as an absolute path or a relative path from the $GITHUB_WORKSPACE.
  • branch - The remote branch that publishing source for GitHub Pages site, defaults to gh-pages.
  • repo - The remote repository slug that publishing source for GitHub Pages site, defaults to current repo. The slug is formatted like user/repo-name.
  • token - The personal access token that authorize access to repo. (cf. GitHub Help)
  • name - The committer name, defaults to $GITHUB_ACTOR.
  • email - The committer name, defaults to ${GITHUB_ACTOR}@users.noreply.github.com.

Example workflow

name: Publish to GitHub Pages

on:
  push:
    branches:
      - master

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - name: Check out
        uses: actions/checkout@v1

      - name: Generate your awesome content
        run: # Your amazing generate action

      - name: Publish generated content to GitHub Pages
        uses: tsunematsu21/[email protected]
        with:
          dir: dist
          branch: gh-pages
          token: ${{ secrets.ACCESS_TOKEN }}

Document

Actions Status

Reference the documentation generated by TypeDoc and published to GitHub Pages by this action.

License

The scripts and documentation in this project are released under the MIT License