Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b263205b1b | ||
|
|
8fd3a55a6f | ||
|
|
61579670d5 | ||
|
|
809601eb1f | ||
|
|
45f5817ce0 | ||
|
|
713b37219b |
@@ -1,5 +1,7 @@
|
|||||||
.git
|
.git
|
||||||
.github
|
.github
|
||||||
|
.hadolint.yaml
|
||||||
LICENSE
|
LICENSE
|
||||||
README.md
|
README.md
|
||||||
|
action.yml
|
||||||
images
|
images
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
ignored:
|
ignored:
|
||||||
- DL3008
|
- DL3018
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
FROM ubuntu:18.04
|
FROM alpine:3.10.2
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apk add --no-cache \
|
||||||
|
bash \
|
||||||
git \
|
git \
|
||||||
openssh-client \
|
openssh-client \
|
||||||
ca-certificates && \
|
ca-certificates && \
|
||||||
|
|||||||
21
README.md
21
README.md
@@ -23,7 +23,7 @@ A GitHub Action to deploy your static site to GitHub Pages with [Static Site Gen
|
|||||||
Generate your deploy key with the following command.
|
Generate your deploy key with the following command.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
ssh-keygen -t rsa -b 4096 -C "your@email.com" -f gh-pages -N ""
|
ssh-keygen -t rsa -b 4096 -C "$(git config user.email)" -f gh-pages -N ""
|
||||||
# You will get 2 files:
|
# You will get 2 files:
|
||||||
# gh-pages.pub (public key)
|
# gh-pages.pub (public key)
|
||||||
# gh-pages (private key)
|
# gh-pages (private key)
|
||||||
@@ -63,7 +63,7 @@ jobs:
|
|||||||
args: --gc --minify --cleanDestinationDir
|
args: --gc --minify --cleanDestinationDir
|
||||||
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2.0.0
|
uses: peaceiris/actions-gh-pages@v2.1.0
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -78,8 +78,8 @@ You can pull a public docker image from Docker Hub.
|
|||||||
By pulling docker images, you can reduce the overall execution time of your workflow. In addition, `latest` tag is provided.
|
By pulling docker images, you can reduce the overall execution time of your workflow. In addition, `latest` tag is provided.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
- uses: peaceiris/actions-gh-pages@v2.0.0
|
- uses: peaceiris/actions-gh-pages@v2.1.0
|
||||||
+ uses: docker://peaceiris/gh-pages:v2.0.0
|
+ uses: docker://peaceiris/gh-pages:v2.1.0
|
||||||
```
|
```
|
||||||
|
|
||||||
- [peaceiris/gh-pages - Docker Hub](https://hub.docker.com/r/peaceiris/gh-pages)
|
- [peaceiris/gh-pages - Docker Hub](https://hub.docker.com/r/peaceiris/gh-pages)
|
||||||
@@ -91,7 +91,16 @@ By pulling docker images, you can reduce the overall execution time of your work
|
|||||||
|
|
||||||
- [peaceiris/gha-hugo - Docker Hub](https://hub.docker.com/r/peaceiris/gha-hugo)
|
- [peaceiris/gha-hugo - Docker Hub](https://hub.docker.com/r/peaceiris/gha-hugo)
|
||||||
|
|
||||||
### `GITHUB_TOKEN`
|
#### `PERSONAL_TOKEN`
|
||||||
|
|
||||||
|
[Create a personal access token (`repo`)](https://github.com/settings/tokens) and add it to Secrets as `PERSONAL_TOKEN`, it works as well as `ACTIONS_DEPLOY_KEY`.
|
||||||
|
|
||||||
|
```diff
|
||||||
|
- ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
|
+ PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `GITHUB_TOKEN`
|
||||||
|
|
||||||
> **NOTES**: This action supports `GITHUB_TOKEN` but it has some problems to deploy to GitHub Pages. See #9
|
> **NOTES**: This action supports `GITHUB_TOKEN` but it has some problems to deploy to GitHub Pages. See #9
|
||||||
|
|
||||||
@@ -137,7 +146,7 @@ jobs:
|
|||||||
run: mkdocs build
|
run: mkdocs build
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
uses: peaceiris/actions-gh-pages@v2.0.0
|
uses: peaceiris/actions-gh-pages@v2.1.0
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
|
|||||||
@@ -23,14 +23,20 @@ if [ -n "${ACTIONS_DEPLOY_KEY}" ]; then
|
|||||||
|
|
||||||
remote_repo="git@github.com:${GITHUB_REPOSITORY}.git"
|
remote_repo="git@github.com:${GITHUB_REPOSITORY}.git"
|
||||||
|
|
||||||
|
elif [ -n "${PERSONAL_TOKEN}" ]; then
|
||||||
|
|
||||||
|
print_info "setup with PERSONAL_TOKEN"
|
||||||
|
|
||||||
|
remote_repo="https://x-access-token:${PERSONAL_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
||||||
|
|
||||||
elif [ -n "${GITHUB_TOKEN}" ]; then
|
elif [ -n "${GITHUB_TOKEN}" ]; then
|
||||||
|
|
||||||
print_info "setup with GITHUB_TOKEN"
|
print_info "setup with GITHUB_TOKEN"
|
||||||
|
|
||||||
remote_repo="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
|
||||||
|
|
||||||
else
|
else
|
||||||
print_error "not found ACTIONS_DEPLOY_KEY or GITHUB_TOKEN"
|
print_error "not found ACTIONS_DEPLOY_KEY, PERSONAL_TOKEN, or GITHUB_TOKEN"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user