mirror of
https://github.com/status-im/actions-gh-pages.git
synced 2025-01-11 22:04:08 +00:00
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/main.workflow
An example with Hugo action.
workflow "GitHub Pages" {
on = "push"
resolves = ["deploy"]
}
action "is-branch-master" {
uses = "actions/bin/filter@master"
args = "branch master"
}
action "is-not-branch-deleted" {
uses = "actions/bin/filter@master"
args = "not deleted"
}
action "build" {
needs = ["is-branch-master", "is-not-branch-deleted"]
uses = "peaceiris/actions-hugo@v0.56.3"
args = ["--gc", "--minify", "--cleanDestinationDir"]
}
action "deploy" {
needs = "build"
uses = "peaceiris/actions-gh-pages@v1.1.0"
env = {
PUBLISH_DIR = "./public"
PUBLISH_BRANCH = "gh-pages"
}
secrets = ["GITHUB_TOKEN"]
}
Workflow overview | Actions log |
---|---|
Examples
MkDocs
- peaceiris/actions-pipenv: GitHub Actions for pipenv
- main.workflow - peaceiris/mkdocs-material-boilerplate
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
MIT License - peaceiris/actions-gh-pages
About the author
Description
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
Languages
TypeScript
91.5%
Shell
3.3%
Dockerfile
3.2%
HTML
0.8%
JavaScript
0.6%
Other
0.5%