Compare commits
67 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c67c4654b | ||
|
|
cbdb69fd85 | ||
|
|
d772f4e8eb | ||
|
|
bca5701620 | ||
|
|
b8c0499d1e | ||
|
|
1e0de0fccd | ||
|
|
e376bcf7c0 | ||
|
|
2437fbe949 | ||
|
|
1bf8e45e86 | ||
|
|
26c5cb82dd | ||
|
|
fb16fe135c | ||
|
|
e13d24c2ac | ||
|
|
830cc44454 | ||
|
|
cf4667b165 | ||
|
|
299744c4cc | ||
|
|
817fe3379a | ||
|
|
dbec91074d | ||
|
|
3514e583e0 | ||
|
|
6da534f570 | ||
|
|
0803e7e969 | ||
|
|
14ef8241ef | ||
|
|
7194caacc4 | ||
|
|
93de081763 | ||
|
|
f035f9f5e7 | ||
|
|
9d15cc0dbc | ||
|
|
626ca71936 | ||
|
|
e4b680c116 | ||
|
|
8563c806e5 | ||
|
|
0ce7e18faa | ||
|
|
46649571f8 | ||
|
|
83eaab4031 | ||
|
|
81110be679 | ||
|
|
455788d397 | ||
|
|
8aea3055ca | ||
|
|
1f2f7ef05e | ||
|
|
141d3dbf3a | ||
|
|
c656aacd4e | ||
|
|
34c4d59419 | ||
|
|
db893610ff | ||
|
|
8daaa39070 | ||
|
|
8dc241e75a | ||
|
|
20ef467283 | ||
|
|
49a4a6dfc2 | ||
|
|
74185ffe80 | ||
|
|
097933f4ab | ||
|
|
8972cc626f | ||
|
|
1468ca9775 | ||
|
|
b172208a72 | ||
|
|
645870064d | ||
|
|
8981758aad | ||
|
|
f3c1954c3b | ||
|
|
f47e77b3ef | ||
|
|
0e1d168f48 | ||
|
|
e4df4b2d92 | ||
|
|
d6d7a5601d | ||
|
|
cd78101d9c | ||
|
|
8076e77c01 | ||
|
|
5e8a6ff9d9 | ||
|
|
78a8692f54 | ||
|
|
69067de181 | ||
|
|
7f7794a793 | ||
|
|
e60d374041 | ||
|
|
8191f265b1 | ||
|
|
4eb9565412 | ||
|
|
e5910bfc4f | ||
|
|
09158e35aa | ||
|
|
26405de510 |
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
|
|
||||||
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: 'Bug: This is a sample issue title'
|
||||||
|
labels: bug
|
||||||
|
assignees: peaceiris
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Your YAML file**
|
||||||
|
- A link to your repository
|
||||||
|
- A link to your YAML file
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
8
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
8
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: GitHub Actions Community Forum
|
||||||
|
url: https://github.community/t5/GitHub-Actions/bd-p/actions
|
||||||
|
about: Please ask questions about GitHub Actions here.
|
||||||
|
- name: GitHub Pages help
|
||||||
|
url: https://help.github.com/en/github/working-with-github-pages
|
||||||
|
about: GitHub Pages documentaion here.
|
||||||
20
.github/ISSUE_TEMPLATE/proposal.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/proposal.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Proposal
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: 'proposal: This is a sample title'
|
||||||
|
labels: proposal
|
||||||
|
assignees: peaceiris
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
28
.github/workflows/docker-image-ci.yml
vendored
28
.github/workflows/docker-image-ci.yml
vendored
@@ -3,7 +3,11 @@ name: docker image ci
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize]
|
types: [opened, synchronize]
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
push:
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
@@ -12,33 +16,25 @@ jobs:
|
|||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
env:
|
env:
|
||||||
DOCKER_IMAGE: docker.pkg.github.com/${{ github.repository }}/action:latest
|
DOCKER_IMAGE: docker.pkg.github.com/${{ github.repository }}/action:latest
|
||||||
run: |
|
run: |
|
||||||
docker build . --file Dockerfile --tag ${DOCKER_IMAGE} ||
|
docker build . --file Dockerfile --tag ${DOCKER_IMAGE}
|
||||||
(echo -e "\e[31m[${GITHUB_WORKFLOW}] failed to build\e[m" && exit 1)
|
|
||||||
|
|
||||||
shellcheck:
|
shellcheck:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
- name: shellcheck
|
- name: shellcheck
|
||||||
run: shellcheck ./entrypoint.sh
|
run: shellcheck ./entrypoint.sh
|
||||||
|
|
||||||
hadolint:
|
hadolint:
|
||||||
runs-on: macOS-10.14
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
with:
|
- run: brew install hadolint
|
||||||
fetch-depth: 1
|
- run: hadolint ./Dockerfile
|
||||||
- name: hadolint
|
|
||||||
run: |
|
|
||||||
brew install hadolint
|
|
||||||
hadolint ./Dockerfile
|
|
||||||
|
|||||||
16
.github/workflows/purge-readme-image-cache.yml
vendored
Normal file
16
.github/workflows/purge-readme-image-cache.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: Purge image cache
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '54 18 * * */7'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
purge:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- run: >
|
||||||
|
curl -sL https://github.com/${GITHUB_REPOSITORY} |
|
||||||
|
grep -oE '<img src="https?://camo.githubusercontent.com/[^"]+' |
|
||||||
|
sed -e 's/<img src="//' |
|
||||||
|
xargs -I % curl -sX PURGE %
|
||||||
17
.github/workflows/stale.yml
vendored
Normal file
17
.github/workflows/stale.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: "Stale"
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "6 6 * * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v1
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
stale-issue-message: 'This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||||
|
stale-pr-message: 'This pull request is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||||
|
days-before-stale: 21
|
||||||
|
days-before-close: 7
|
||||||
24
.github/workflows/update-major-tag.yml
vendored
Normal file
24
.github/workflows/update-major-tag.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: Update major tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Update major tag
|
||||||
|
if: github.event.release.prerelease == false
|
||||||
|
run: |
|
||||||
|
git config user.name "${GITHUB_ACTOR}"
|
||||||
|
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
||||||
|
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
|
||||||
|
export TAG_NAME="${GITHUB_REF##refs/tags/}"
|
||||||
|
export TAG_MAJOR="${TAG_NAME%%.*}"
|
||||||
|
git tag "${TAG_MAJOR}" -m "Release ${TAG_NAME}" || git tag -d "${TAG_MAJOR}" ; git push --delete origin "${TAG_MAJOR}"
|
||||||
|
git tag "${TAG_MAJOR}" -m "Release ${TAG_NAME}" || true
|
||||||
|
git push origin "${TAG_MAJOR}"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.10.2
|
FROM alpine:3.11.0
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
bash \
|
bash \
|
||||||
|
|||||||
290
README.md
290
README.md
@@ -1,7 +1,7 @@
|
|||||||
[](https://github.com/peaceiris/actions-gh-pages/blob/master/LICENSE)
|
[](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/latest)
|
||||||
[](https://github.com/peaceiris/actions-gh-pages/releases)
|
[](https://github.com/peaceiris/actions-gh-pages/releases)
|
||||||
[](https://github.com/peaceiris/actions-gh-pages/actions)
|

|
||||||
[](https://hub.docker.com/r/peaceiris/gh-pages)
|
[](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">
|
<img width="400" alt="GitHub Actions for deploying to GitHub Pages with Static Site Generators" src="./images/ogp.svg">
|
||||||
@@ -11,20 +11,44 @@
|
|||||||
## GitHub Actions for GitHub Pages
|
## GitHub Actions for GitHub Pages
|
||||||
|
|
||||||
This is a **GitHub Action** to deploy your static files to **GitHub Pages**.
|
This is a **GitHub Action** to deploy your static files to **GitHub Pages**.
|
||||||
This deploy action can be combined simply and freely with [Static Site Generators]. (Hugo, MkDocs, Gatsby, GitBook, etc.)
|
This deploy action can be combined simply and freely with [Static Site Generators]. (Hugo, MkDocs, Gatsby, GitBook, mdBook, etc.)
|
||||||
|
|
||||||
[Static Site Generators]: https://www.staticgen.com/
|
[Static Site Generators]: https://www.staticgen.com/
|
||||||
|
|
||||||
|
The next example step will deploy `./public` directory to the remote `gh-pages` branch.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
|
# PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
||||||
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
PUBLISH_DIR: ./public
|
PUBLISH_DIR: ./public
|
||||||
```
|
```
|
||||||
|
|
||||||
The above example step will deploy `./public` directory to `gh-pages` branch.
|
Three tokens are supported.
|
||||||
|
|
||||||
|
| Token | Private repo | Public repo | Protocol | Setup |
|
||||||
|
|---|:---:|:---:|---|---|
|
||||||
|
| `GITHUB_TOKEN` | ✅️ | ❌️ | HTTPS | Unnecessary |
|
||||||
|
| `PERSONAL_TOKEN` | ✅️ | ✅️ | HTTPS | Necessary |
|
||||||
|
| `ACTIONS_DEPLOY_KEY` | ✅️ | ✅️ | SSH | Necessary |
|
||||||
|
|
||||||
|
Do you want to skip the docker build step? OK, the script mode is available.
|
||||||
|
|
||||||
|
```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/entrypoint.sh
|
||||||
|
bash ./entrypoint.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -46,6 +70,7 @@ The above example step will deploy `./public` directory to `gh-pages` branch.
|
|||||||
- [⭐️ Suppressing empty commits](#%EF%B8%8F-suppressing-empty-commits)
|
- [⭐️ Suppressing empty commits](#%EF%B8%8F-suppressing-empty-commits)
|
||||||
- [⭐️ Keeping existing files](#%EF%B8%8F-keeping-existing-files)
|
- [⭐️ Keeping existing files](#%EF%B8%8F-keeping-existing-files)
|
||||||
- [⭐️ Deploy to external repository](#%EF%B8%8F-deploy-to-external-repository)
|
- [⭐️ Deploy to external repository](#%EF%B8%8F-deploy-to-external-repository)
|
||||||
|
- [⭐️ Force orphan](#%EF%B8%8F-force-orphan)
|
||||||
- [⭐️ Script mode](#%EF%B8%8F-script-mode)
|
- [⭐️ Script mode](#%EF%B8%8F-script-mode)
|
||||||
- [Tips and FAQ](#tips-and-faq)
|
- [Tips and FAQ](#tips-and-faq)
|
||||||
- [⭐️ Use the latest and specific release](#%EF%B8%8F-use-the-latest-and-specific-release)
|
- [⭐️ Use the latest and specific release](#%EF%B8%8F-use-the-latest-and-specific-release)
|
||||||
@@ -57,6 +82,8 @@ The above example step will deploy `./public` directory to `gh-pages` branch.
|
|||||||
- [⭐️ React and Next](#%EF%B8%8F-react-and-next)
|
- [⭐️ React and Next](#%EF%B8%8F-react-and-next)
|
||||||
- [⭐️ Vue and Nuxt](#%EF%B8%8F-vue-and-nuxt)
|
- [⭐️ Vue and Nuxt](#%EF%B8%8F-vue-and-nuxt)
|
||||||
- [⭐️ Static Site Generators with Python](#%EF%B8%8F-static-site-generators-with-python)
|
- [⭐️ Static Site Generators with Python](#%EF%B8%8F-static-site-generators-with-python)
|
||||||
|
- [⭐️ mdBook (Rust)](#%EF%B8%8F-mdbook-rust)
|
||||||
|
- [⭐️ Flutter Web](#%EF%B8%8F-flutter-web)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
- [About the author](#about-the-author)
|
- [About the author](#about-the-author)
|
||||||
|
|
||||||
@@ -117,20 +144,20 @@ jobs:
|
|||||||
build-deploy:
|
build-deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v1
|
||||||
# with:
|
# with:
|
||||||
# submodules: true
|
# submodules: true
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2.2.1
|
uses: peaceiris/actions-hugo@v2
|
||||||
with:
|
with:
|
||||||
hugo-version: '0.58.3'
|
hugo-version: '0.59.1'
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: hugo --gc --minify --cleanDestinationDir
|
run: hugo --minify
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -165,6 +192,7 @@ PUBLISH_BRANCH: master # deploying branch
|
|||||||
[User and Organization Pages sites]: https://help.github.com/en/articles/user-organization-and-project-pages#user-and-organization-pages-sites
|
[User and Organization Pages sites]: https://help.github.com/en/articles/user-organization-and-project-pages#user-and-organization-pages-sites
|
||||||
|
|
||||||

|

|
||||||
|

|
||||||
|
|
||||||
<div align="right">
|
<div align="right">
|
||||||
<a href="#table-of-contents">Back to TOC ☝️</a>
|
<a href="#table-of-contents">Back to TOC ☝️</a>
|
||||||
@@ -180,8 +208,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.4.0
|
- uses: peaceiris/actions-gh-pages@v2
|
||||||
+ uses: docker://peaceiris/gh-pages:v2.4.0
|
+ uses: docker://peaceiris/gh-pages:v2
|
||||||
```
|
```
|
||||||
|
|
||||||
- [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)
|
||||||
@@ -218,7 +246,7 @@ For example:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -235,7 +263,7 @@ For example:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -254,11 +282,11 @@ For example:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2.5.0-rc0
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
EXTERNAL_REPOSITORY: username/external-repository
|
EXTERNAL_REPOSITORY: username/external-repository
|
||||||
PUBLISH_BRANCH: master
|
PUBLISH_BRANCH: gh-pages
|
||||||
PUBLISH_DIR: ./public
|
PUBLISH_DIR: ./public
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -267,6 +295,22 @@ 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.
|
Be careful, `GITHUB_TOKEN` has no permission to access to external repositories.
|
||||||
|
|
||||||
|
### ⭐️ Force orphan
|
||||||
|
|
||||||
|
From `v2.6.0`, we can set the `forceOrphan: true` option.
|
||||||
|
This allows you to make your publish branch with only the latest commit.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Deploy
|
||||||
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
|
env:
|
||||||
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
|
PUBLISH_BRANCH: gh-pages
|
||||||
|
PUBLISH_DIR: ./public
|
||||||
|
with:
|
||||||
|
forceOrphan: true
|
||||||
|
```
|
||||||
|
|
||||||
### ⭐️ Script mode
|
### ⭐️ Script mode
|
||||||
|
|
||||||
From `v2.5.0`, we can run this action as a shell script.
|
From `v2.5.0`, we can run this action as a shell script.
|
||||||
@@ -283,7 +327,7 @@ There is no Docker build or pull step, so it will start immediately.
|
|||||||
PUBLISH_DIR: ./public
|
PUBLISH_DIR: ./public
|
||||||
SCRIPT_MODE: true
|
SCRIPT_MODE: true
|
||||||
run: |
|
run: |
|
||||||
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2.5.0/entrypoint.sh
|
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2/entrypoint.sh
|
||||||
bash ./entrypoint.sh
|
bash ./entrypoint.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -377,18 +421,27 @@ jobs:
|
|||||||
build-deploy:
|
build-deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
- name: build
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '10.16'
|
node-version: '10.x'
|
||||||
- run: |
|
|
||||||
npm install
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
- name: deploy
|
- name: Cache dependencies
|
||||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
|
- run: npm ci
|
||||||
|
|
||||||
|
- run: npm run build
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -416,27 +469,31 @@ jobs:
|
|||||||
build-deploy:
|
build-deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
- name: setup node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '10.16'
|
node-version: '10.x'
|
||||||
|
|
||||||
- name: install
|
- name: Cache dependencies
|
||||||
run: npm install
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
- name: format
|
- run: npm ci
|
||||||
run: npm run format
|
|
||||||
|
|
||||||
- name: test
|
- run: npm run format
|
||||||
run: npm run test
|
|
||||||
|
|
||||||
- name: build
|
- run: npm run test
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: deploy
|
- run: npm run build
|
||||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
|
||||||
|
- name: Deploy
|
||||||
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -466,27 +523,35 @@ jobs:
|
|||||||
build-deploy:
|
build-deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
- name: setup node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '10.16'
|
node-version: '10.x'
|
||||||
|
|
||||||
- name: install
|
- name: Get yarn cache
|
||||||
run: yarn install
|
id: yarn-cache
|
||||||
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
|
|
||||||
- name: build
|
- name: Cache dependencies
|
||||||
run: yarn build
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ steps.yarn-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
- name: export
|
- run: yarn install
|
||||||
run: yarn export
|
|
||||||
|
|
||||||
- name: add nojekyll
|
- run: yarn build
|
||||||
run: touch ./out/.nojekyll
|
|
||||||
|
- run: yarn export
|
||||||
|
|
||||||
|
- run: touch ./out/.nojekyll
|
||||||
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -516,24 +581,29 @@ jobs:
|
|||||||
build-deploy:
|
build-deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
- name: setup node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '10.16'
|
node-version: '10.x'
|
||||||
|
|
||||||
- name: install
|
- name: Cache dependencies
|
||||||
run: npm install
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
- name: test
|
- run: npm ci
|
||||||
run: npm test
|
|
||||||
|
|
||||||
- name: generate
|
- run: npm test
|
||||||
run: npm run generate
|
|
||||||
|
- run: npm run generate
|
||||||
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -566,29 +636,119 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v1
|
||||||
with:
|
with:
|
||||||
python-version: '3.6'
|
python-version: '3.6'
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/.cache/pip
|
||||||
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pip-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip
|
python3 -m pip install --upgrade pip
|
||||||
pip install -r ./requirements.txt
|
python3 -m pip install -r ./requirements.txt
|
||||||
|
|
||||||
- name: Build
|
- run: mkdocs build
|
||||||
run: mkdocs build
|
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
PUBLISH_DIR: ./site
|
PUBLISH_DIR: ./site
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### ⭐️ mdBook (Rust)
|
||||||
|
|
||||||
|
An example GitHub Actions workflow to deploy [rust-lang/mdBook] site to GitHub Pages.
|
||||||
|
|
||||||
|
[rust-lang/mdBook]: https://github.com/rust-lang/mdBook
|
||||||
|
|
||||||
|
- [peaceiris/actions-mdbook: GitHub Actions for mdBook (rust-lang/mdBook)](https://github.com/peaceiris/actions-mdbook)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: github pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Setup mdBook
|
||||||
|
uses: peaceiris/actions-mdbook@v1
|
||||||
|
with:
|
||||||
|
mdbook-version: '0.3.5'
|
||||||
|
# mdbook-version: 'latest'
|
||||||
|
|
||||||
|
- run: mdbook build
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
|
env:
|
||||||
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
|
PUBLISH_BRANCH: gh-pages
|
||||||
|
PUBLISH_DIR: ./book
|
||||||
|
```
|
||||||
|
|
||||||
|
### ⭐️ Flutter Web
|
||||||
|
|
||||||
|
An exapmle workflow for [Flutter web project].
|
||||||
|
Setup [Flutter] with [subosito/flutter-action].
|
||||||
|
|
||||||
|
[Flutter]: https://github.com/flutter/flutter
|
||||||
|
[Flutter web project]: https://flutter.dev/docs/get-started/web
|
||||||
|
[subosito/flutter-action]: https://github.com/subosito/flutter-action
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: github pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-deploy:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Setup Flutter
|
||||||
|
uses: subosito/flutter-action@v1
|
||||||
|
with:
|
||||||
|
channel: 'beta'
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
flutter config --enable-web
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: flutter build web
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
uses: peaceiris/actions-gh-pages@v2
|
||||||
|
env:
|
||||||
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
|
PUBLISH_BRANCH: gh-pages
|
||||||
|
PUBLISH_DIR: ./build/web
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -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.'
|
description: 'GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.'
|
||||||
author: 'peaceiris'
|
author: 'peaceiris'
|
||||||
runs:
|
runs:
|
||||||
@@ -16,3 +16,7 @@ inputs:
|
|||||||
description: 'If existing files in the publish branch should be not removed before deploying'
|
description: 'If existing files in the publish branch should be not removed before deploying'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
|
forceOrphan:
|
||||||
|
description: 'Keep only the latest commit on a GitHub Pages branch'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
|||||||
@@ -77,7 +77,13 @@ fi
|
|||||||
remote_branch="${PUBLISH_BRANCH}"
|
remote_branch="${PUBLISH_BRANCH}"
|
||||||
|
|
||||||
local_dir="${HOME}/ghpages_${RANDOM}"
|
local_dir="${HOME}/ghpages_${RANDOM}"
|
||||||
if git clone --depth=1 --single-branch --branch "${remote_branch}" "${remote_repo}" "${local_dir}"; then
|
|
||||||
|
if [[ "${INPUT_FORCEORPHAN}" == "true" ]]; then
|
||||||
|
print_info "force ophan: ${INPUT_FORCEORPHAN}"
|
||||||
|
cd "${PUBLISH_DIR}"
|
||||||
|
git init
|
||||||
|
git checkout --orphan "${remote_branch}"
|
||||||
|
elif git clone --depth=1 --single-branch --branch "${remote_branch}" "${remote_repo}" "${local_dir}"; then
|
||||||
cd "${local_dir}"
|
cd "${local_dir}"
|
||||||
|
|
||||||
if [[ ${INPUT_KEEPFILES} == "true" ]]; then
|
if [[ ${INPUT_KEEPFILES} == "true" ]]; then
|
||||||
@@ -86,7 +92,7 @@ if git clone --depth=1 --single-branch --branch "${remote_branch}" "${remote_rep
|
|||||||
git rm -r --ignore-unmatch '*'
|
git rm -r --ignore-unmatch '*'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find "${GITHUB_WORKSPACE}/${PUBLISH_DIR}" -maxdepth 1 | \
|
find "${GITHUB_WORKSPACE}/${PUBLISH_DIR}" -maxdepth 1 -not -name ".git" -not -name ".github" | \
|
||||||
tail -n +2 | \
|
tail -n +2 | \
|
||||||
xargs -I % cp -rf % "${local_dir}/"
|
xargs -I % cp -rf % "${local_dir}/"
|
||||||
else
|
else
|
||||||
@@ -110,5 +116,10 @@ else
|
|||||||
git commit --allow-empty -m "${COMMIT_MESSAGE}"
|
git commit --allow-empty -m "${COMMIT_MESSAGE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git push origin "${remote_branch}"
|
if [[ ${INPUT_FORCEORPHAN} == "true" ]]; then
|
||||||
|
git push origin --force "${remote_branch}"
|
||||||
|
else
|
||||||
|
git push origin "${remote_branch}"
|
||||||
|
fi
|
||||||
|
|
||||||
print_info "${GITHUB_SHA} was successfully deployed"
|
print_info "${GITHUB_SHA} was successfully deployed"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
BIN
images/user_repo.jpg
Normal file
BIN
images/user_repo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
Reference in New Issue
Block a user