GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly. https://github.com/marketplace/actions/github-pages-action
Go to file
peaceiris e43f914d03 fix: readme 2019-09-02 18:35:05 +09:00
.github add: release docker image with latest tag 2019-09-02 18:28:50 +09:00
images remove: GitHub Actions v1 workflow overview images 2019-08-22 03:41:21 +09:00
.dockerignore add: action 2019-05-22 06:53:54 +09:00
Dockerfile Fetch remote before testing whether the publish branch exists (#7) 2019-09-02 17:47:55 +09:00
LICENSE add: action 2019-05-22 06:53:54 +09:00
README.md fix: readme 2019-09-02 18:35:05 +09:00
entrypoint.sh Fetch remote before testing whether the publish branch exists (#7) 2019-09-02 17:47:55 +09:00

README.md

license release GitHub release date GitHub Actions status

GitHub Actions for deploying to GitHub Pages with Static Site Generators

GitHub Actions for deploying to GitHub Pages

A GitHub Action to deploy your static site to GitHub Pages with Static Site Generators (Hugo, MkDocs, Gatsby, GitBook, etc.)

Getting started

Create .github/workflows/gh-pages.yml

An example with Hugo action.

peaceiris/actions-hugo latest version peaceiris/actions-gh-pages latest version

name: github pages

on:
  push:
    branches:
    - master

jobs:
  build-deploy:
    runs-on: ubuntu-18.04
    steps:
    - uses: actions/checkout@master
    - name: build
      uses: peaceiris/actions-hugo@v0.57.2
      if: github.event.deleted == false
      with:
        args: --gc --minify --cleanDestinationDir
    - name: deploy
      uses: peaceiris/actions-gh-pages@v1.1.0
      if: success()
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        PUBLISH_BRANCH: gh-pages
        PUBLISH_DIR: ./public

Examples

MkDocs

peaceiris/actions-gh-pages latest version

workflow "MkDocs workflow" {
  on = "push"
  resolves = ["deploy"]
}

action "branch-filter" {
  uses = "actions/bin/filter@master"
  args = "branch master"
}

action "pipenv-sync" {
  needs = ["branch-filter"]
  uses = "peaceiris/actions-pipenv@3.6"
  args = "sync"
}

action "mkdocs-build" {
  needs = ["pipenv-sync"]
  uses = "peaceiris/actions-pipenv@3.6"
  args = ["run", "mkdocs", "build", "--config-file", "./mkdocs-sample.yml"]
}

action "deploy" {
  needs = ["mkdocs-build"]
  uses = "peaceiris/actions-gh-pages@v1.1.0"
  env = {
    PUBLISH_DIR = "./site"
    PUBLISH_BRANCH = "gh-pages"
  }
  secrets = ["GITHUB_TOKEN"]
}

License

About the author