mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2026-10-06 03:21:36 +00:00
add: action
This commit is contained in:
1 parent
913ab499f6
commit
036c4a14e0
8 files changed
+158
-3
No files matched your search
@@ -1,2 +1,73 @@
|
||||
# actions-gh-deploy
|
||||
GitHub Actions for deploying to GitHub Pages with Static Site Generators
|
||||
[](https://github.com/peaceiris/actions-gh-pages/blob/master/LICENSE)
|
||||
[](https://github.com/peaceiris/actions-gh-pages/releases/latest)
|
||||
[](https://github.com/peaceiris/actions-gh-pages/releases)
|
||||
|
||||
<img width="400" alt="GitHub Actions for deploying to GitHub Pages with Static Site Generators" src="./images/ogp.svg">
|
||||
|
||||
|
||||
|
||||
## 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.)
|
||||
|
||||
[Static Site Generators]: https://www.staticgen.com/
|
||||
|
||||
|
||||
|
||||
## Getting started
|
||||
|
||||
### (1) Add deploy Key
|
||||
|
||||
1. Generate deploy key `ssh-keygen -t rsa -b 4096 -C "your@email.com" -f gh-pages -N ""`
|
||||
2. Go to "Settings > Deploy Keys" of repository.
|
||||
3. Add your public key within "Allow write access" option.
|
||||
4. Go to "Settings > Secrets" of repository.
|
||||
5. Add your private deploy key as `ACTIONS_DEPLOY_KEY`
|
||||
|
||||
### (2) Create `main.workflow`
|
||||
|
||||
An example with Hugo action.
|
||||
|
||||
- [peaceiris/actions-hugo: GitHub Actions for Hugo extended](https://github.com/peaceiris/actions-hugo)
|
||||
|
||||
```hcl
|
||||
workflow "GitHub Pages" {
|
||||
on = "push"
|
||||
resolves = ["deploy"]
|
||||
}
|
||||
|
||||
action "is-branch-master" {
|
||||
uses = "actions/bin/filter@master"
|
||||
args = "branch master"
|
||||
}
|
||||
|
||||
action "build" {
|
||||
needs = "is-branch-master"
|
||||
uses = "peaceiris/actions-hugo@v0.55.6"
|
||||
args = ["--gc", "--minify", "--cleanDestinationDir"]
|
||||
}
|
||||
|
||||
action "deploy" {
|
||||
needs = "build"
|
||||
uses = "peaceiris/actions-gh-pages@v1.0.0"
|
||||
env = {
|
||||
PUBLISH_DIR = "./public"
|
||||
PUBLISH_BRANCH = "gh-pages"
|
||||
}
|
||||
secrets = ["ACTIONS_DEPLOY_KEY"]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## License
|
||||
|
||||
[MIT License - peaceiris/actions-gh-pages]
|
||||
|
||||
[MIT License - peaceiris/actions-gh-pages]: https://github.com/peaceiris/actions-gh-pages/blob/master/LICENSE
|
||||
|
||||
|
||||
|
||||
## Supprt author
|
||||
|
||||
<a href="https://www.patreon.com/peaceiris"><img src="./images/patreon.jpg" alt="peaceiris - Patreon" width="150px"></a>
|
||||
Reference in new issue
Block a user