Compare commits
16 Commits
v2.5.0-rc1
...
v2.5.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4df4b2d92 | ||
|
|
d6d7a5601d | ||
|
|
cd78101d9c | ||
|
|
8076e77c01 | ||
|
|
5e8a6ff9d9 | ||
|
|
78a8692f54 | ||
|
|
69067de181 | ||
|
|
7f7794a793 | ||
|
|
e60d374041 | ||
|
|
8191f265b1 | ||
|
|
4eb9565412 | ||
|
|
e5910bfc4f | ||
|
|
09158e35aa | ||
|
|
26405de510 | ||
|
|
855ba06744 | ||
|
|
159b07d518 |
10
.dependabot/config.yml
Normal file
10
.dependabot/config.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
version: 1
|
||||
update_configs:
|
||||
- package_manager: "docker"
|
||||
directory: "/"
|
||||
update_schedule: "weekly"
|
||||
default_labels:
|
||||
- "dependencies"
|
||||
- "docker"
|
||||
commit_message:
|
||||
prefix: "deps"
|
||||
3
.github/CODEOWNERS
vendored
Normal file
3
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
|
||||
|
||||
* @peaceiris
|
||||
9
.github/FUNDING.yml
vendored
9
.github/FUNDING.yml
vendored
@@ -1,9 +0,0 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
# github: peaceiris
|
||||
patreon: peaceiris
|
||||
issuehunt: 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
|
||||
2
.github/workflows/docker-image-ci.yml
vendored
2
.github/workflows/docker-image-ci.yml
vendored
@@ -4,6 +4,8 @@ on:
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM alpine:3.10.2
|
||||
FROM alpine:3.10.3
|
||||
|
||||
RUN apk add --no-cache \
|
||||
bash \
|
||||
|
||||
66
README.md
66
README.md
@@ -1,7 +1,7 @@
|
||||
[](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)
|
||||
[](https://github.com/peaceiris/actions-gh-pages/actions)
|
||||

|
||||
[](https://hub.docker.com/r/peaceiris/gh-pages)
|
||||
|
||||
<img width="400" alt="GitHub Actions for deploying to GitHub Pages with Static Site Generators" src="./images/ogp.svg">
|
||||
@@ -17,7 +17,7 @@ This deploy action can be combined simply and freely with [Static Site Generator
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
@@ -46,6 +46,7 @@ The above example step will deploy `./public` directory to `gh-pages` branch.
|
||||
- [⭐️ Suppressing empty commits](#%EF%B8%8F-suppressing-empty-commits)
|
||||
- [⭐️ Keeping existing files](#%EF%B8%8F-keeping-existing-files)
|
||||
- [⭐️ Deploy to external repository](#%EF%B8%8F-deploy-to-external-repository)
|
||||
- [⭐️ Script mode](#%EF%B8%8F-script-mode)
|
||||
- [Tips and FAQ](#tips-and-faq)
|
||||
- [⭐️ Use the latest and specific release](#%EF%B8%8F-use-the-latest-and-specific-release)
|
||||
- [⭐️ How to add `CNAME`](#%EF%B8%8F-how-to-add-cname)
|
||||
@@ -121,15 +122,15 @@ jobs:
|
||||
# submodules: true
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2.2.1
|
||||
uses: peaceiris/actions-hugo@v2.2.2
|
||||
with:
|
||||
hugo-version: '0.58.3'
|
||||
|
||||
- name: Build
|
||||
run: hugo --gc --minify --cleanDestinationDir
|
||||
run: hugo --minify
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
@@ -179,8 +180,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.
|
||||
|
||||
```diff
|
||||
- uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
+ uses: docker://peaceiris/gh-pages:v2.4.0
|
||||
- uses: peaceiris/actions-gh-pages@v2.5.0
|
||||
+ uses: docker://peaceiris/gh-pages:v2.5.0
|
||||
```
|
||||
|
||||
- [peaceiris/gh-pages - Docker Hub](https://hub.docker.com/r/peaceiris/gh-pages)
|
||||
@@ -196,7 +197,7 @@ By pulling docker images, you can reduce the overall execution time of your work
|
||||
|
||||
### ⭐️ `GITHUB_TOKEN`
|
||||
|
||||
> **NOTES**: Do not use `GITHUB_TOKEN`.
|
||||
> ⚠️ **NOTES**: `GITHUB_TOKEN` works only on a **private** repository.
|
||||
>
|
||||
> This action supports `GITHUB_TOKEN` but it has some problems to deploy to GitHub Pages. GitHub team is investigating that. See [Issue #9]
|
||||
|
||||
@@ -217,7 +218,7 @@ For example:
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
@@ -234,7 +235,7 @@ For example:
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
@@ -247,16 +248,17 @@ For example:
|
||||
|
||||
By default, your files are published to the repository which is running this action.
|
||||
If you want to publish to another repository on GitHub, set the environment variable `EXTERNAL_REPOSITORY` to `<username>/<external-repository>`.
|
||||
This option is available from `v2.5.0`.
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
EXTERNAL_REPOSITORY: username/username.github.io
|
||||
PUBLISH_BRANCH: master
|
||||
EXTERNAL_REPOSITORY: username/external-repository
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
PUBLISH_DIR: ./public
|
||||
```
|
||||
|
||||
@@ -265,6 +267,26 @@ When you use `ACTIONS_DEPLOY_KEY`, set your private key to the repository which
|
||||
|
||||
Be careful, `GITHUB_TOKEN` has no permission to access to external repositories.
|
||||
|
||||
### ⭐️ Script mode
|
||||
|
||||
From `v2.5.0`, we can run this action as a shell script.
|
||||
There is no Docker build or pull step, so it will start immediately.
|
||||
|
||||
- `ACTIONS_DEPLOY_KEY` requires `SCRIPT_MODE: true`
|
||||
- `*_TOKEN` do not require `SCRIPT_MODE`
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
PUBLISH_DIR: ./public
|
||||
SCRIPT_MODE: true
|
||||
run: |
|
||||
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2.5.0/entrypoint.sh
|
||||
bash ./entrypoint.sh
|
||||
```
|
||||
|
||||
<div align="right">
|
||||
<a href="#table-of-contents">Back to TOC ☝️</a>
|
||||
</div>
|
||||
@@ -360,13 +382,13 @@ jobs:
|
||||
- name: build
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '10.16'
|
||||
node-version: '10.x'
|
||||
- run: |
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
- name: deploy
|
||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
@@ -399,7 +421,7 @@ jobs:
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '10.16'
|
||||
node-version: '10.x'
|
||||
|
||||
- name: install
|
||||
run: npm install
|
||||
@@ -414,7 +436,7 @@ jobs:
|
||||
run: npm run build
|
||||
|
||||
- name: deploy
|
||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
@@ -449,7 +471,7 @@ jobs:
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '10.16'
|
||||
node-version: '10.x'
|
||||
|
||||
- name: install
|
||||
run: yarn install
|
||||
@@ -464,7 +486,7 @@ jobs:
|
||||
run: touch ./out/.nojekyll
|
||||
|
||||
- name: deploy
|
||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
@@ -499,7 +521,7 @@ jobs:
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '10.16'
|
||||
node-version: '10.x'
|
||||
|
||||
- name: install
|
||||
run: npm install
|
||||
@@ -511,7 +533,7 @@ jobs:
|
||||
run: npm run generate
|
||||
|
||||
- name: deploy
|
||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
@@ -559,7 +581,7 @@ jobs:
|
||||
run: mkdocs build
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: 'Deploy action for GitHub Pages'
|
||||
name: 'GitHub Pages action'
|
||||
description: 'GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.'
|
||||
author: 'peaceiris'
|
||||
runs:
|
||||
|
||||
@@ -28,10 +28,16 @@ if [ -n "${ACTIONS_DEPLOY_KEY}" ]; then
|
||||
|
||||
print_info "setup with ACTIONS_DEPLOY_KEY"
|
||||
|
||||
mkdir /root/.ssh
|
||||
ssh-keyscan -t rsa github.com > /root/.ssh/known_hosts
|
||||
echo "${ACTIONS_DEPLOY_KEY}" > /root/.ssh/id_rsa
|
||||
chmod 400 /root/.ssh/id_rsa
|
||||
if [ -n "${SCRIPT_MODE}" ]; then
|
||||
print_info "run as SCRIPT_MODE"
|
||||
SSH_DIR="${HOME}/.ssh"
|
||||
else
|
||||
SSH_DIR="/root/.ssh"
|
||||
fi
|
||||
mkdir "${SSH_DIR}"
|
||||
ssh-keyscan -t rsa github.com > "${SSH_DIR}/known_hosts"
|
||||
echo "${ACTIONS_DEPLOY_KEY}" > "${SSH_DIR}/id_rsa"
|
||||
chmod 400 "${SSH_DIR}/id_rsa"
|
||||
|
||||
remote_repo="git@github.com:${PUBLISH_REPOSITORY}.git"
|
||||
|
||||
@@ -44,7 +50,7 @@ elif [ -n "${PERSONAL_TOKEN}" ]; then
|
||||
elif [ -n "${GITHUB_TOKEN}" ]; then
|
||||
|
||||
print_info "setup with GITHUB_TOKEN"
|
||||
print_error "Do not use GITHUB_TOKEN, See #9"
|
||||
print_error "GITHUB_TOKEN works only private repo, See #9"
|
||||
|
||||
if [ -n "${EXTERNAL_REPOSITORY}" ]; then
|
||||
print_error "can not use GITHUB_TOKEN to deploy to a external repository"
|
||||
@@ -70,7 +76,7 @@ fi
|
||||
|
||||
remote_branch="${PUBLISH_BRANCH}"
|
||||
|
||||
local_dir="${HOME}/$(tr -cd 'a-f0-9' < /dev/urandom | head -c 32)"
|
||||
local_dir="${HOME}/ghpages_${RANDOM}"
|
||||
if git clone --depth=1 --single-branch --branch "${remote_branch}" "${remote_repo}" "${local_dir}"; then
|
||||
cd "${local_dir}"
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Reference in New Issue
Block a user