Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95773e0623 | ||
|
|
f2d1faaacf | ||
|
|
9bfcfe68ee | ||
|
|
6009c110fc | ||
|
|
87dceaf2d6 | ||
|
|
3400745573 | ||
|
|
7c2aa28333 |
8
.github/FUNDING.yml
vendored
Normal file
8
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: peaceiris
|
||||
patreon: peaceiris
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
custom: # Replace with a single custom sponsorship URL
|
||||
66
README.md
66
README.md
@@ -18,11 +18,20 @@ A GitHub Action to deploy your static site to GitHub Pages with [Static Site Gen
|
||||
|
||||
### (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`
|
||||
Generate deploy key with the following command.
|
||||
|
||||
```sh
|
||||
ssh-keygen -t rsa -b 4096 -C "your@email.com" -f gh-pages -N ""
|
||||
|
||||
# You will get 2 files:
|
||||
# gh-pages.pub (public key)
|
||||
# gh-pages (private key)
|
||||
```
|
||||
|
||||
Next, Go to **Repository Settings**
|
||||
|
||||
- Go to **Deploy Keys** and add your public key with the "Allow write access"
|
||||
- Go to **Secrets** and add your private key as `ACTIONS_DEPLOY_KEY`
|
||||
|
||||
### (2) Create `main.workflow`
|
||||
|
||||
@@ -60,6 +69,49 @@ action "deploy" {
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### MkDocs
|
||||
|
||||
- [peaceiris/actions-pipenv: GitHub Actions for pipenv](https://github.com/peaceiris/actions-pipenv)
|
||||
- [main.workflow - peaceiris/mkdocs-material-boilerplate](https://github.com/peaceiris/mkdocs-material-boilerplate/blob/master/.github/main.workflow)
|
||||
|
||||
```hcl
|
||||
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.0.0"
|
||||
env = {
|
||||
PUBLISH_DIR = "./site"
|
||||
PUBLISH_BRANCH = "gh-pages"
|
||||
}
|
||||
secrets = ["ACTIONS_DEPLOY_KEY"]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## License
|
||||
|
||||
[MIT License - peaceiris/actions-gh-pages]
|
||||
@@ -68,6 +120,8 @@ action "deploy" {
|
||||
|
||||
|
||||
|
||||
## Supprt author
|
||||
## About the author
|
||||
|
||||
- [peaceiris's homepage](https://peaceiris.com/)
|
||||
|
||||
<a href="https://www.patreon.com/peaceiris"><img src="./images/patreon.jpg" alt="peaceiris - Patreon" width="150px"></a>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# setup ssh
|
||||
if [[ -z "${ACTIONS_DEPLOY_KEY}" ]]; then
|
||||
if [ -z "${ACTIONS_DEPLOY_KEY}" ]; then
|
||||
echo "error: not found ACTIONS_DEPLOY_KEY"
|
||||
exit 1
|
||||
fi
|
||||
@@ -11,12 +11,12 @@ echo "${ACTIONS_DEPLOY_KEY}" > /root/.ssh/id_rsa
|
||||
chmod 400 /root/.ssh/id_rsa
|
||||
|
||||
# push to gh-pages branch
|
||||
if [[ -z "${PUBLISH_DIR}" ]]; then
|
||||
if [ -z "${PUBLISH_DIR}" ]; then
|
||||
echo "error: not found PUBLISH_DIR"
|
||||
exit 1
|
||||
fi
|
||||
cd ${PUBLISH_DIR}
|
||||
if [[ -z "${PUBLISH_BRANCH}" ]]; then
|
||||
cd "${PUBLISH_DIR}" || exit 1
|
||||
if [ -z "${PUBLISH_BRANCH}" ]; then
|
||||
echo "error: not found PUBLISH_BRANCH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user