Compare commits

...

65 Commits

Author SHA1 Message Date
peaceiris
43687c847a chore(release): 3.1.0
Some checks failed
Release / release (push) Has been cancelled
2020-02-19 22:58:13 +09:00
peaceiris
218e357d06 chore(release): Add build assets 2020-02-19 22:58:12 +09:00
Shohei Ueda
2f5ccc92df fix: Use onetime workdir name (#109)
* chore: Allow to release from not master

* chore(release): 3.0.4-0
* chore(release): 3.0.4-1
2020-02-19 22:56:40 +09:00
Shohei Ueda
195ab8005d deps: Rollback @types/node 13 to 12 (#111) 2020-02-19 12:16:41 +09:00
dependabot-preview[bot]
591c4bdf2e deps: bump @types/node from 13.7.1 to 13.7.2 (#110) 2020-02-19 02:38:01 +00:00
dependabot-preview[bot]
1c50baa294 deps: bump @typescript-eslint/eslint-plugin from 2.19.2 to 2.20.0 (#105)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.19.2 to 2.20.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.20.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-18 15:40:15 +09:00
dependabot-preview[bot]
73c09c703e deps: bump @typescript-eslint/parser from 2.19.2 to 2.20.0 (#106) 2020-02-18 06:21:35 +00:00
wu-yu-xuan
55a68e34ca refactor: fix typo and remove useless function (#107) 2020-02-18 14:30:50 +09:00
Shohei Ueda
60c31d23a8 docs: fix 2020-02-15 13:37:16 +09:00
Shohei Ueda
1887981f72 docs: update status of github_token 2020-02-15 13:36:36 +09:00
dependabot-preview[bot]
49a6939dbb deps: bump husky from 4.2.1 to 4.2.3 (#102) 2020-02-13 04:47:49 +00:00
dependabot-preview[bot]
0b00dd2a9f deps: bump @types/node from 13.7.0 to 13.7.1 (#99) 2020-02-12 05:16:14 +00:00
dependabot-preview[bot]
5d5e9338cc deps: bump @typescript-eslint/eslint-plugin from 2.19.0 to 2.19.2 (#97) 2020-02-11 08:24:41 +00:00
dependabot-preview[bot]
8b52b41ecb deps: bump @typescript-eslint/parser from 2.19.0 to 2.19.2 (#96) 2020-02-11 08:18:57 +00:00
dependabot-preview[bot]
0a1a58196b deps: bump eslint-plugin-jest from 23.6.0 to 23.7.0 (#95) 2020-02-10 07:30:56 +00:00
peaceiris
476fa94197 fix: Change final message 2020-02-08 17:31:09 +09:00
Shohei Ueda
0e542f9f92 deps: bump node from 12.14.1 to 12.15.0 (#94) 2020-02-08 10:28:28 +09:00
dependabot-preview[bot]
aec195ebb4 deps: bump @types/jest from 25.1.1 to 25.1.2 (#93) 2020-02-07 02:49:09 +00:00
peaceiris
41015898aa docs: rename author to Maintainer 2020-02-06 23:28:54 +09:00
Shohei Ueda
a7866b5bd3 docs: update publish_branch for v3 2020-02-06 19:30:48 +09:00
Shohei Ueda
752214aa33 docs: update job name 2020-02-06 15:49:52 +09:00
peaceiris
0b24a9f462 chore(release): Remove build assets [skip ci] 2020-02-06 15:40:05 +09:00
peaceiris
354d78ff6f chore(release): 3.0.3
Some checks failed
Release / release (push) Has been cancelled
2020-02-06 15:40:04 +09:00
peaceiris
7605281c4b chore(release): Add build assets 2020-02-06 15:40:03 +09:00
peaceiris
2948e5eda8 docs: update example of publish_branch 2020-02-06 15:39:37 +09:00
peaceiris
e8d0817a48 chore(release): Remove build assets [skip ci] 2020-02-06 15:22:10 +09:00
peaceiris
9d8382b381 chore(release): 3.0.3-0
Some checks failed
Release / release (push) Has been cancelled
2020-02-06 15:22:10 +09:00
peaceiris
8ccc2d9608 chore(release): Add build assets 2020-02-06 15:22:08 +09:00
Shohei Ueda
1b6740cb30 fix: Enable to create branch for first deployment (#92)
* fix: Enable to create branch for first deployment
* fix: remove pull_request

* ci: remove lint-staged husky for testing
* ci: Add git checkout {package-lock,package}.json
2020-02-06 15:21:18 +09:00
peaceiris
479c59e6d2 chore(release): Remove build assets [skip ci] 2020-02-06 01:55:56 +09:00
peaceiris
a22f6fc3b7 chore(release): 3.0.2
Some checks failed
Release / release (push) Has been cancelled
2020-02-06 01:55:55 +09:00
peaceiris
f28cc017a9 chore(release): Add build assets 2020-02-06 01:55:54 +09:00
peaceiris
f8b5a36401 fix: add filePath 2020-02-06 01:52:45 +09:00
peaceiris
848165cf9f fix: copy force 2020-02-06 01:50:30 +09:00
peaceiris
fb54d6af4d fix: add debug 2020-02-06 01:41:17 +09:00
peaceiris
6edc4c9764 fix: copy directories #89 2020-02-06 01:38:12 +09:00
peaceiris
d35854bdf8 docs: update log example for v3 2020-02-05 20:38:55 +09:00
peaceiris
f0177d176f docs: Add Supported Platforms table 2020-02-05 20:32:49 +09:00
peaceiris
0ba5bf3eeb docs: Add CodeFactor badge 2020-02-05 20:26:02 +09:00
peaceiris
cfdf8c43ed ci: use github_token for windows-latest 2020-02-05 20:11:40 +09:00
peaceiris
ce8c273a61 chore(release): Remove build assets [skip ci] 2020-02-05 20:06:02 +09:00
peaceiris
5378bd89b8 chore(release): 3.0.1
Some checks failed
Release / release (push) Has been cancelled
2020-02-05 20:06:01 +09:00
peaceiris
db62f9acd4 chore(release): Add build assets 2020-02-05 20:06:00 +09:00
Shohei Ueda
ed21b6a594 feat: Add getHomeDir() for windows (#86) 2020-02-05 20:04:31 +09:00
peaceiris
9f11da81ae refactor: change to core.debug 2020-02-05 18:50:44 +09:00
Shohei Ueda
a1375a4637 docs: remove v2 example 2020-02-05 18:38:36 +09:00
Shohei Ueda
1a26eaca33 docs: update 2020-02-05 18:37:47 +09:00
peaceiris
1a13108865 docs: update for v3 2020-02-05 17:12:51 +09:00
peaceiris
d0de38a352 docs: update for v3 2020-02-05 17:12:06 +09:00
peaceiris
b3cfcb13c0 docs: update for v3 2020-02-05 17:11:16 +09:00
peaceiris
b1aaa85b67 docs: update for v3 2020-02-05 17:10:00 +09:00
peaceiris
f1e7cd608c docs: update for v3 2020-02-05 17:09:37 +09:00
peaceiris
07a3f2915e docs: update for v3 2020-02-05 17:09:00 +09:00
peaceiris
02c38586a5 docs: update for v3 2020-02-05 17:08:19 +09:00
peaceiris
59bbb98387 docs: update for v3 2020-02-05 17:06:55 +09:00
peaceiris
9b3fcdf515 docs: remove Script mode section 2020-02-05 17:06:05 +09:00
peaceiris
be27dcce48 docs: update for v3 2020-02-05 17:05:37 +09:00
peaceiris
ccf71d1162 docs: update for v3 2020-02-05 17:04:27 +09:00
peaceiris
5fe4aa3f24 docs: update for v3 2020-02-05 17:03:44 +09:00
peaceiris
428902c6cd docs: update for v3 2020-02-05 17:02:53 +09:00
peaceiris
00bca7b88c docs: update for v3 2020-02-05 17:00:50 +09:00
peaceiris
c940278a4c docs: update overview 2020-02-05 15:44:30 +09:00
peaceiris
9cec798451 docs: update GitHub Actions badge 2020-02-05 15:39:32 +09:00
peaceiris
ec95e8e7aa docs: Add link to v2 2020-02-05 14:44:12 +09:00
peaceiris
5570fc7c70 chore(release): Remove build assets [skip ci] 2020-02-05 14:41:09 +09:00
13 changed files with 723 additions and 2616 deletions

View File

@@ -23,13 +23,13 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
if: contains(github.event.head_commit.message, '[skip ci]') == false if: contains(github.event.head_commit.message, '[skip ci]') == false
strategy: strategy:
max-parallel: 1
matrix: matrix:
os: os:
- 'ubuntu-18.04' - 'ubuntu-18.04'
# - 'macos-latest' - 'macos-latest'
# - 'windows-latest' - 'windows-latest'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Read .nvmrc - name: Read .nvmrc
@@ -42,6 +42,12 @@ jobs:
node-version: '${{ steps.nvm.outputs.NVMRC }}' node-version: '${{ steps.nvm.outputs.NVMRC }}'
- run: npm ci - run: npm ci
- name: Remove lint-staged husky
run: |
npm uninstall lint-staged husky
git checkout package-lock.json package.json
- run: npm run build - run: npm run build
- name: Setup mdBook - name: Setup mdBook
@@ -62,11 +68,12 @@ jobs:
echo "::set-output name=deploy_tag_name::deploy-${TAG_NAME}" echo "::set-output name=deploy_tag_name::deploy-${TAG_NAME}"
- name: Deploy - name: Deploy
if: matrix.os != 'windows-latest'
uses: ./ uses: ./
with: with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
# github_token: ${{ secrets.GITHUB_TOKEN }} # github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_branch: master # publish_branch: gh-pages
publish_dir: ./test_projects/mdbook/book publish_dir: ./test_projects/mdbook/book
# external_repository: '' # external_repository: ''
allow_empty_commit: true allow_empty_commit: true
@@ -78,9 +85,21 @@ jobs:
# tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }} # tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
# tag_message: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}' # tag_message: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}'
# - name: Deploy v2 - name: Deploy
# uses: peaceiris/actions-gh-pages@v2 if: matrix.os == 'windows-latest'
# env: uses: ./
# ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} with:
# PUBLISH_BRANCH: gh-pages # deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
# PUBLISH_DIR: ./test_projects/mdbook/book github_token: ${{ secrets.GITHUB_TOKEN }}
# personal_token: ${{ secrets.PERSONAL_TOKEN }}
# publish_branch: gh-pages
publish_dir: ./test_projects/mdbook/book
# external_repository: ''
allow_empty_commit: true
# keep_files: true
# force_orphan: true
# user_name: iris
# user_email: email@peaceiris.com
# commit_message: ${{ github.event.head_commit.message }}
# tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
# tag_message: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}'

2
.nvmrc
View File

@@ -1 +1 @@
12.14.1 12.15.0

View File

@@ -2,6 +2,177 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
# [3.1.0](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.3...v3.1.0) (2020-02-19)
### deps
* bump @types/jest from 25.1.1 to 25.1.2 (#93) ([aec195e](https://github.com/peaceiris/actions-gh-pages/commit/aec195ebb4e984f62f48139a5e24aa85ea31e891)), closes [#93](https://github.com/peaceiris/actions-gh-pages/issues/93)
* bump @types/node from 13.7.0 to 13.7.1 (#99) ([0b00dd2](https://github.com/peaceiris/actions-gh-pages/commit/0b00dd2a9f91c1854f4b1cfe68dc30891ebccc9f)), closes [#99](https://github.com/peaceiris/actions-gh-pages/issues/99)
* bump @types/node from 13.7.1 to 13.7.2 (#110) ([591c4bd](https://github.com/peaceiris/actions-gh-pages/commit/591c4bdf2ee1c6aa5f1958c4553902feac06dcfe)), closes [#110](https://github.com/peaceiris/actions-gh-pages/issues/110)
* bump @typescript-eslint/eslint-plugin from 2.19.0 to 2.19.2 (#97) ([5d5e933](https://github.com/peaceiris/actions-gh-pages/commit/5d5e9338ccbca63f80f5ee66ba9e9eff14bacb68)), closes [#97](https://github.com/peaceiris/actions-gh-pages/issues/97)
* bump @typescript-eslint/eslint-plugin from 2.19.2 to 2.20.0 (#105) ([1c50baa](https://github.com/peaceiris/actions-gh-pages/commit/1c50baa294d259f81459f7a495f8d0d2a50a1b6d)), closes [#105](https://github.com/peaceiris/actions-gh-pages/issues/105)
* bump @typescript-eslint/parser from 2.19.0 to 2.19.2 (#96) ([8b52b41](https://github.com/peaceiris/actions-gh-pages/commit/8b52b41ecb191f50bd5efc9ee2c0266a2d171d14)), closes [#96](https://github.com/peaceiris/actions-gh-pages/issues/96)
* bump @typescript-eslint/parser from 2.19.2 to 2.20.0 (#106) ([73c09c7](https://github.com/peaceiris/actions-gh-pages/commit/73c09c703e63c0b442ffa50624ace10eaa929280)), closes [#106](https://github.com/peaceiris/actions-gh-pages/issues/106)
* bump eslint-plugin-jest from 23.6.0 to 23.7.0 (#95) ([0a1a581](https://github.com/peaceiris/actions-gh-pages/commit/0a1a58196ba5bf48e168475e0ac3898fbd3043e2)), closes [#95](https://github.com/peaceiris/actions-gh-pages/issues/95)
* bump husky from 4.2.1 to 4.2.3 (#102) ([49a6939](https://github.com/peaceiris/actions-gh-pages/commit/49a6939dbb77d7656228cdc3bed6a99d5124a6b2)), closes [#102](https://github.com/peaceiris/actions-gh-pages/issues/102)
* bump node from 12.14.1 to 12.15.0 (#94) ([0e542f9](https://github.com/peaceiris/actions-gh-pages/commit/0e542f9f9231c005e1a6363a33a69fdbde436085)), closes [#94](https://github.com/peaceiris/actions-gh-pages/issues/94)
* Rollback @types/node 13 to 12 (#111) ([195ab80](https://github.com/peaceiris/actions-gh-pages/commit/195ab8005d4af142c40fd8e53a59783b697d75d9)), closes [#111](https://github.com/peaceiris/actions-gh-pages/issues/111)
### docs
* fix ([60c31d2](https://github.com/peaceiris/actions-gh-pages/commit/60c31d23a8a096624a3b9a0955a05ea9941dc140))
* rename author to Maintainer ([4101589](https://github.com/peaceiris/actions-gh-pages/commit/41015898aad0abad9d0760bc576e4748e476d4f9))
* update job name ([752214a](https://github.com/peaceiris/actions-gh-pages/commit/752214aa33756f6e097f908671681a13865a9991))
* update publish_branch for v3 ([a7866b5](https://github.com/peaceiris/actions-gh-pages/commit/a7866b5bd3a121a460c8c39cb1c9d1586db6b231))
* update status of github_token ([1887981](https://github.com/peaceiris/actions-gh-pages/commit/1887981f72e59b54f68febb4fa4786e7e153ef6d))
### fix
* Change final message ([476fa94](https://github.com/peaceiris/actions-gh-pages/commit/476fa94197aea4d3f74e5619ae77ebf966fd5fff))
* Use onetime workdir name (#109) ([2f5ccc9](https://github.com/peaceiris/actions-gh-pages/commit/2f5ccc92dfcf8e85d9d3c19dc842a440380253bf)), closes [#109](https://github.com/peaceiris/actions-gh-pages/issues/109)
### refactor
* fix typo and remove useless function (#107) ([55a68e3](https://github.com/peaceiris/actions-gh-pages/commit/55a68e34ca406d99b5b2a4549d7ade5eeb03d860)), closes [#107](https://github.com/peaceiris/actions-gh-pages/issues/107)
## [3.0.4-1](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.4-0...v3.0.4-1) (2020-02-19)
### deps
* bump @types/node from 13.7.1 to 13.7.2 (#110) ([591c4bd](https://github.com/peaceiris/actions-gh-pages/commit/591c4bdf2ee1c6aa5f1958c4553902feac06dcfe)), closes [#110](https://github.com/peaceiris/actions-gh-pages/issues/110)
* Rollback @types/node 13 to 12 (#111) ([195ab80](https://github.com/peaceiris/actions-gh-pages/commit/195ab8005d4af142c40fd8e53a59783b697d75d9)), closes [#111](https://github.com/peaceiris/actions-gh-pages/issues/111)
### fix
* Add await ([0031179](https://github.com/peaceiris/actions-gh-pages/commit/00311793aa104bf99501373756461475b6752f16))
* convert to string ([cbe4d56](https://github.com/peaceiris/actions-gh-pages/commit/cbe4d56fb8bd50d63919f783483f74c694a3dd9b))
* use onetime workdir name ([0d912a1](https://github.com/peaceiris/actions-gh-pages/commit/0d912a1314ce9d77f29bc0c1fada559223dd5563))
### refactor
* Add info message ([8e6c12a](https://github.com/peaceiris/actions-gh-pages/commit/8e6c12a2b5f973c8736f831398d0fe7c980f1431))
## [3.0.4-0](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.3...v3.0.4-0) (2020-02-18)
### chore
* Allow to release from not master ([3c7cd58](https://github.com/peaceiris/actions-gh-pages/commit/3c7cd587e403a76d6725a0e84796cf12a59752f3))
### deps
* bump @types/jest from 25.1.1 to 25.1.2 (#93) ([aec195e](https://github.com/peaceiris/actions-gh-pages/commit/aec195ebb4e984f62f48139a5e24aa85ea31e891)), closes [#93](https://github.com/peaceiris/actions-gh-pages/issues/93)
* bump @types/node from 13.7.0 to 13.7.1 (#99) ([0b00dd2](https://github.com/peaceiris/actions-gh-pages/commit/0b00dd2a9f91c1854f4b1cfe68dc30891ebccc9f)), closes [#99](https://github.com/peaceiris/actions-gh-pages/issues/99)
* bump @typescript-eslint/eslint-plugin from 2.19.0 to 2.19.2 (#97) ([5d5e933](https://github.com/peaceiris/actions-gh-pages/commit/5d5e9338ccbca63f80f5ee66ba9e9eff14bacb68)), closes [#97](https://github.com/peaceiris/actions-gh-pages/issues/97)
* bump @typescript-eslint/eslint-plugin from 2.19.2 to 2.20.0 (#105) ([1c50baa](https://github.com/peaceiris/actions-gh-pages/commit/1c50baa294d259f81459f7a495f8d0d2a50a1b6d)), closes [#105](https://github.com/peaceiris/actions-gh-pages/issues/105)
* bump @typescript-eslint/parser from 2.19.0 to 2.19.2 (#96) ([8b52b41](https://github.com/peaceiris/actions-gh-pages/commit/8b52b41ecb191f50bd5efc9ee2c0266a2d171d14)), closes [#96](https://github.com/peaceiris/actions-gh-pages/issues/96)
* bump @typescript-eslint/parser from 2.19.2 to 2.20.0 (#106) ([73c09c7](https://github.com/peaceiris/actions-gh-pages/commit/73c09c703e63c0b442ffa50624ace10eaa929280)), closes [#106](https://github.com/peaceiris/actions-gh-pages/issues/106)
* bump eslint-plugin-jest from 23.6.0 to 23.7.0 (#95) ([0a1a581](https://github.com/peaceiris/actions-gh-pages/commit/0a1a58196ba5bf48e168475e0ac3898fbd3043e2)), closes [#95](https://github.com/peaceiris/actions-gh-pages/issues/95)
* bump husky from 4.2.1 to 4.2.3 (#102) ([49a6939](https://github.com/peaceiris/actions-gh-pages/commit/49a6939dbb77d7656228cdc3bed6a99d5124a6b2)), closes [#102](https://github.com/peaceiris/actions-gh-pages/issues/102)
* bump node from 12.14.1 to 12.15.0 (#94) ([0e542f9](https://github.com/peaceiris/actions-gh-pages/commit/0e542f9f9231c005e1a6363a33a69fdbde436085)), closes [#94](https://github.com/peaceiris/actions-gh-pages/issues/94)
### docs
* fix ([60c31d2](https://github.com/peaceiris/actions-gh-pages/commit/60c31d23a8a096624a3b9a0955a05ea9941dc140))
* rename author to Maintainer ([4101589](https://github.com/peaceiris/actions-gh-pages/commit/41015898aad0abad9d0760bc576e4748e476d4f9))
* update job name ([752214a](https://github.com/peaceiris/actions-gh-pages/commit/752214aa33756f6e097f908671681a13865a9991))
* update publish_branch for v3 ([a7866b5](https://github.com/peaceiris/actions-gh-pages/commit/a7866b5bd3a121a460c8c39cb1c9d1586db6b231))
* update status of github_token ([1887981](https://github.com/peaceiris/actions-gh-pages/commit/1887981f72e59b54f68febb4fa4786e7e153ef6d))
### fix
* Add removing workDir at the end ([5ba5849](https://github.com/peaceiris/actions-gh-pages/commit/5ba5849ab229d5b6eecc1d13de82e71999961cdc))
* Change final message ([476fa94](https://github.com/peaceiris/actions-gh-pages/commit/476fa94197aea4d3f74e5619ae77ebf966fd5fff))
* tag fetching ([6595e02](https://github.com/peaceiris/actions-gh-pages/commit/6595e02d683d6ca8275d76e2818662da80ac685a))
* tag fetching ([6fe5c9e](https://github.com/peaceiris/actions-gh-pages/commit/6fe5c9e76213b6d5bc542be649cbe0289e947ab6))
### refactor
* fix typo and remove useless function (#107) ([55a68e3](https://github.com/peaceiris/actions-gh-pages/commit/55a68e34ca406d99b5b2a4549d7ade5eeb03d860)), closes [#107](https://github.com/peaceiris/actions-gh-pages/issues/107)
## [3.0.3](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.3-0...v3.0.3) (2020-02-06)
### docs
* update example of publish_branch ([2948e5e](https://github.com/peaceiris/actions-gh-pages/commit/2948e5eda85d99ffc20cda677353918ea9ea3f45))
## [3.0.3-0](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.2...v3.0.3-0) (2020-02-06)
### fix
* Enable to create branch for first deployment (#92) ([1b6740c](https://github.com/peaceiris/actions-gh-pages/commit/1b6740cb30fc6a5a695a015144589862eb241b7d)), closes [#92](https://github.com/peaceiris/actions-gh-pages/issues/92)
## [3.0.2](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.1...v3.0.2) (2020-02-05)
### ci
* use github_token for windows-latest ([cfdf8c4](https://github.com/peaceiris/actions-gh-pages/commit/cfdf8c43ed170ce3bcfc1b4ee5ba50000e89f9e7))
### docs
* Add CodeFactor badge ([0ba5bf3](https://github.com/peaceiris/actions-gh-pages/commit/0ba5bf3eeb5f0ad9e42dc6344afa736b47dac67f))
* Add Supported Platforms table ([f0177d1](https://github.com/peaceiris/actions-gh-pages/commit/f0177d176f9464c11cbdff5a68dbecd6e630e371))
* update log example for v3 ([d35854b](https://github.com/peaceiris/actions-gh-pages/commit/d35854bdf87ba4311c5b5ba738260e4eb89c2295))
### fix
* add debug ([fb54d6a](https://github.com/peaceiris/actions-gh-pages/commit/fb54d6af4d2abbf7a42806620594b173c2f55882))
* add filePath ([f8b5a36](https://github.com/peaceiris/actions-gh-pages/commit/f8b5a36401de48c3bf2fda47a51b010350405163))
* copy directories #89 ([6edc4c9](https://github.com/peaceiris/actions-gh-pages/commit/6edc4c976449147551137b19eb7bc092d9d129ec)), closes [#89](https://github.com/peaceiris/actions-gh-pages/issues/89)
* copy force ([848165c](https://github.com/peaceiris/actions-gh-pages/commit/848165cf9f01c61b1f2e83d433177a9f46ce5ea7))
## [3.0.1](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.0...v3.0.1) (2020-02-05)
### docs
* Add link to v2 ([ec95e8e](https://github.com/peaceiris/actions-gh-pages/commit/ec95e8e7aae2075200c33461a0f3aa640d7fbe02))
* remove Script mode section ([9b3fcdf](https://github.com/peaceiris/actions-gh-pages/commit/9b3fcdf51572449ce5f346724d01e878bd811834))
* remove v2 example ([a1375a4](https://github.com/peaceiris/actions-gh-pages/commit/a1375a463794f123e06ddb6af0d74ef453d74fa0))
* update ([1a26eac](https://github.com/peaceiris/actions-gh-pages/commit/1a26eaca33cf4f1d162fc37fd45cab6ea999140e))
* update for v3 ([1a13108](https://github.com/peaceiris/actions-gh-pages/commit/1a1310886515195d8b9052e68aec5a973dd3779d))
* update for v3 ([d0de38a](https://github.com/peaceiris/actions-gh-pages/commit/d0de38a352de7896c0bc618c3977f00f6a34151d))
* update for v3 ([b3cfcb1](https://github.com/peaceiris/actions-gh-pages/commit/b3cfcb13c0e3d5b76fb2b306fafbc0bfdc349e2e))
* update for v3 ([b1aaa85](https://github.com/peaceiris/actions-gh-pages/commit/b1aaa85b6766b71fd96a06d1ea8a99a5247e7b6c))
* update for v3 ([f1e7cd6](https://github.com/peaceiris/actions-gh-pages/commit/f1e7cd608c631ec6a3c48e1e76f17b6c8a468ada))
* update for v3 ([07a3f29](https://github.com/peaceiris/actions-gh-pages/commit/07a3f2915ef742feb191caf4315f92c5dbe24657))
* update for v3 ([02c3858](https://github.com/peaceiris/actions-gh-pages/commit/02c38586a5b45e217af006473aa99749917bce73))
* update for v3 ([59bbb98](https://github.com/peaceiris/actions-gh-pages/commit/59bbb98387fa6cde2495176555efd39a3c68b6b5))
* update for v3 ([be27dcc](https://github.com/peaceiris/actions-gh-pages/commit/be27dcce4894bf0847e64b2ba676b9de08979d21))
* update for v3 ([ccf71d1](https://github.com/peaceiris/actions-gh-pages/commit/ccf71d1162ce030d5f8aa4bb1e05c45d83912c67))
* update for v3 ([5fe4aa3](https://github.com/peaceiris/actions-gh-pages/commit/5fe4aa3f24fd2a3f7cf683b04c29895c6882c5de))
* update for v3 ([428902c](https://github.com/peaceiris/actions-gh-pages/commit/428902c6cd381168d113898fa3fd53e83ca658b2))
* update for v3 ([00bca7b](https://github.com/peaceiris/actions-gh-pages/commit/00bca7b88cea3a6aff0cd9e90cc297f90981dfe8))
* update GitHub Actions badge ([9cec798](https://github.com/peaceiris/actions-gh-pages/commit/9cec79845182679864d2e9f2b137c1829773b4a0))
* update overview ([c940278](https://github.com/peaceiris/actions-gh-pages/commit/c940278a4c780afbd658b4a3f0f7834039913401))
### feat
* Add getHomeDir() for windows (#86) ([ed21b6a](https://github.com/peaceiris/actions-gh-pages/commit/ed21b6a5942b1be9f75103a2661d908d41ed9ea9)), closes [#86](https://github.com/peaceiris/actions-gh-pages/issues/86)
### refactor
* change to core.debug ([9f11da8](https://github.com/peaceiris/actions-gh-pages/commit/9f11da81ae3ead3c8929c35266dd40a0ddfd2bd1))
# [3.0.0](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.0-1...v3.0.0) (2020-02-05) # [3.0.0](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.0-1...v3.0.0) (2020-02-05)

610
README.md
View File

@@ -1,13 +1,17 @@
[![license](https://img.shields.io/github/license/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/blob/master/LICENSE) [![license](https://img.shields.io/github/license/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/blob/master/LICENSE)
[![release](https://img.shields.io/github/release/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/releases/latest) [![release](https://img.shields.io/github/release/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/releases/latest)
[![GitHub release date](https://img.shields.io/github/release-date/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/releases) [![GitHub release date](https://img.shields.io/github/release-date/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/releases)
![GitHub Actions status](https://github.com/peaceiris/actions-gh-pages/workflows/docker%20image%20ci/badge.svg) ![Test Action](https://github.com/peaceiris/actions-gh-pages/workflows/Test%20Action/badge.svg?branch=master&event=push)
[![Docker Hub Build Status](https://img.shields.io/docker/cloud/build/peaceiris/gh-pages.svg)](https://hub.docker.com/r/peaceiris/gh-pages) [![CodeFactor](https://www.codefactor.io/repository/github/peaceiris/actions-gh-pages/badge)](https://www.codefactor.io/repository/github/peaceiris/actions-gh-pages)
[![Release Feed](https://img.shields.io/badge/release-feed-yellow)](https://github.com/peaceiris/actions-gh-pages/releases.atom) [![Release Feed](https://img.shields.io/badge/release-feed-yellow)](https://github.com/peaceiris/actions-gh-pages/releases.atom)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=peaceiris/actions-gh-pages)](https://dependabot.com) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=peaceiris/actions-gh-pages)](https://dependabot.com)
<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">
> This Action has been migrated to a TypeScript Action (version 3).
>
> The old Docker Action is [peaceiris/actions-gh-pages@v2](https://github.com/peaceiris/actions-gh-pages/tree/v2)
## GitHub Actions for GitHub Pages ## GitHub Actions for GitHub Pages
@@ -19,40 +23,38 @@ This deploy action can be combined simply and freely with [Static Site Generator
The next example step will deploy `./public` directory to the remote `gh-pages` branch. 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 uses: peaceiris/actions-gh-pages@v3
env: with:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
# PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} # github_token: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # personal_token: ${{ secrets.PERSONAL_TOKEN }}
PUBLISH_BRANCH: gh-pages publish_dir: ./public
PUBLISH_DIR: ./public
``` ```
### Supported Tokens
Three tokens are supported. Three tokens are supported.
| Token | Private repo | Public repo | Protocol | Setup | | Token | Private repo | Public repo | Protocol | Setup |
|---|:---:|:---:|---|---| |---|:---:|:---:|---|---|
| `GITHUB_TOKEN` | ✅️ | (1) | HTTPS | Unnecessary | | `github_token` | ✅️ | (1) | HTTPS | Unnecessary |
| `PERSONAL_TOKEN` | ✅️ | ✅️ | HTTPS | Necessary | | `personal_token` | ✅️ | ✅️ | HTTPS | Necessary |
| `ACTIONS_DEPLOY_KEY` | ✅️ | ✅️ | SSH | Necessary | | `deploy_key` | ✅️ | ✅️ | SSH | Necessary |
1. Currently, GitHub Actions does not support to trigger a GitHub Pages build event using GITHUB_TOKEN on a public repository. 1. ~~Currently, GitHub Actions does not support to trigger a GitHub Pages build event using GITHUB_TOKEN on a public repository.~~ Maybe, we can use it but there is no official announcement by GitHub.
Do you want to skip the docker build step? OK, the script mode is available. ### Supported Platforms
```yaml | runs-on | `deploy_key` | `github_token` | `personal_token` |
- name: Deploy |---|:---:|:---:|:---:|
env: | ubuntu-18.04 | ✅️ | ✅️ | ✅️ |
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} | macos-latest | ✅️ | ✅️ | ✅️ |
PUBLISH_BRANCH: gh-pages | windows-latest | (2) | ✅️ | ✅️ |
PUBLISH_DIR: ./public
SCRIPT_MODE: true 2. WIP, See [Issue #87](https://github.com/peaceiris/actions-gh-pages/issues/87)
run: |
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2/entrypoint.sh
bash ./entrypoint.sh
```
@@ -68,17 +70,15 @@ Do you want to skip the docker build step? OK, the script mode is available.
- [⭐️ Repository type - Project](#%EF%B8%8F-repository-type---project) - [⭐️ Repository type - Project](#%EF%B8%8F-repository-type---project)
- [⭐️ Repository type - User and Organization](#%EF%B8%8F-repository-type---user-and-organization) - [⭐️ Repository type - User and Organization](#%EF%B8%8F-repository-type---user-and-organization)
- [Options](#options) - [Options](#options)
- [⭐️ Pull action image from Docker Hub](#%EF%B8%8F-pull-action-image-from-docker-hub) - [⭐️ `personal_token`](#%EF%B8%8F-personal_token)
- [⭐️ `PERSONAL_TOKEN`](#%EF%B8%8F-personal_token) - [⭐️ `github_token`](#%EF%B8%8F-github_token)
- [⭐️ `GITHUB_TOKEN`](#%EF%B8%8F-github_token) - [⭐️ Allow empty commits](#%EF%B8%8F-allow-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) - [⭐️ Force orphan](#%EF%B8%8F-force-orphan)
- [⭐️ Set Git username and email](#%EF%B8%8F-set-git-username-and-email) - [⭐️ Set Git username and email](#%EF%B8%8F-set-git-username-and-email)
- [⭐️ Set custom commit message](#%EF%B8%8F-set-custom-commit-message) - [⭐️ Set custom commit message](#%EF%B8%8F-set-custom-commit-message)
- [⭐️ Create Git tag](#%EF%B8%8F-create-git-tag) - [⭐️ Create Git tag](#%EF%B8%8F-create-git-tag)
- [⭐️ 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)
- [⭐️ How to add `CNAME`](#%EF%B8%8F-how-to-add-cname) - [⭐️ How to add `CNAME`](#%EF%B8%8F-how-to-add-cname)
@@ -93,7 +93,7 @@ Do you want to skip the docker build step? OK, the script mode is available.
- [⭐️ Flutter Web](#%EF%B8%8F-flutter-web) - [⭐️ Flutter Web](#%EF%B8%8F-flutter-web)
- [⭐️ Elm](#%EF%B8%8F-elm) - [⭐️ Elm](#%EF%B8%8F-elm)
- [License](#license) - [License](#license)
- [About the author](#about-the-author) - [Maintainer](#maintainer)
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -146,30 +146,29 @@ name: github pages
on: on:
push: push:
branches: branches:
- master - master
jobs: jobs:
build-deploy: deploy:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
# with: # with:
# submodules: true # submodules: true
- name: Setup Hugo - name: Setup Hugo
uses: peaceiris/actions-hugo@v2 uses: peaceiris/actions-hugo@v2
with: with:
hugo-version: '0.59.1' hugo-version: '0.64.0'
- name: Build - name: Build
run: hugo --minify run: hugo --minify
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env: with:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages publish_dir: ./public
PUBLISH_DIR: ./public
``` ```
The above example is for [Project Pages sites]. (`<username>/<project_name>` repository) The above example is for [Project Pages sites]. (`<username>/<project_name>` repository)
@@ -185,15 +184,30 @@ The above example is for [Project Pages sites]. (`<username>/<project_name>` rep
#### ⭐️ Repository type - User and Organization #### ⭐️ Repository type - User and Organization
For [User and Organization Pages sites] (`<username>/<username>.github.io` repository), For [User and Organization Pages sites] (`<username>/<username>.github.io` repository),
we have to set `master` branch to `PUBLISH_BRANCH`. we have to set `master` branch to `publish_branch`.
A default value of `publish_branch` is `gh-pages`.
```yaml ```yaml
on: on:
push: push:
branches: branches:
- source # default branch - source # default branch
PUBLISH_BRANCH: master # deploying branch jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- run: somebuild
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./public
publish_branch: master # deploying branch
``` ```
[Project Pages sites]: https://help.github.com/en/articles/user-organization-and-project-pages#project-pages-sites [Project Pages sites]: https://help.github.com/en/articles/user-organization-and-project-pages#project-pages-sites
@@ -210,113 +224,92 @@ PUBLISH_BRANCH: master # deploying branch
## Options ## Options
### ⭐️ Pull action image from Docker Hub ### ⭐️ `personal_token`
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
+ uses: docker://peaceiris/gh-pages:v2
```
- [peaceiris/gh-pages - Docker Hub](https://hub.docker.com/r/peaceiris/gh-pages)
### ⭐️ `PERSONAL_TOKEN`
[Generate 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`. [Generate 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 ```diff
- ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} - deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
+ PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} + personal_token: ${{ secrets.PERSONAL_TOKEN }}
``` ```
### ⭐️ `GITHUB_TOKEN` ### ⭐️ `github_token`
> ⚠️ **NOTES**: `GITHUB_TOKEN` works only on a **private** repository. > ⚠️ **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] > This action supports `GITHUB_TOKEN` but it has some problems to deploy to GitHub Pages. GitHub team is investigating that. See [Issue #9]
[Issue #9]: https://github.com/peaceiris/actions-gh-pages/issues/9 [Issue #9]: https://github.com/peaceiris/actions-gh-pages/issues/9
```diff ```diff
- ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} - deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }}
``` ```
### ⭐️ Suppressing empty commits ### ⭐️ Allow empty commits
By default, a commit will always be generated and pushed to the `PUBLISH_BRANCH`, even if nothing changed. If you want to suppress this behavior, set the optional parameter `emptyCommits` to `false`. cf. [Issue #21] By default, a commit will not be generated when no file changes. If you want to allow an empty commit, set the optional parameter `allow_empty_commit` to `true`.
[Issue #21]: https://github.com/peaceiris/actions-gh-pages/issues/21
For example: For example:
```yaml ```yaml
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
with: with:
emptyCommits: false deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./public
allow_empty_commit: true
``` ```
### ⭐️ Keeping existing files ### ⭐️ Keeping existing files
By default, existing files in the publish branch are removed before adding the ones from publish dir. If you want the action to add new files but leave existing ones untouched, set the optional parameter `keepFiles` to `true`. By default, existing files in the publish branch are removed before adding the ones from publish dir. If you want the action to add new files but leave existing ones untouched, set the optional parameter `keep_files` to `true`.
For example: For example:
```yaml ```yaml
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
with: with:
keepFiles: true deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./public
keep_files: true
``` ```
### ⭐️ Deploy to external repository ### ⭐️ Deploy to external repository
By default, your files are published to the repository which is running this action. 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>`. 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: For example:
```yaml ```yaml
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env: with:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
EXTERNAL_REPOSITORY: username/external-repository external_repository: username/external-repository
PUBLISH_BRANCH: gh-pages publish_branch: gh-pages
PUBLISH_DIR: ./public publish_dir: ./public
``` ```
You can use `ACTIONS_DEPLOY_KEY` or `PERSONAL_TOKEN`. You can use `deploy_key` or `personal_token`.
When you use `ACTIONS_DEPLOY_KEY`, set your private key to the repository which includes this action and set your public key to your external repository. When you use `deploy_key`, set your private key to the repository which includes this action and set your public key to your external repository.
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 ### ⭐️ Force orphan
From `v2.6.0`, we can set the `forceOrphan: true` option. We can set the `force_orphan: true` option.
This allows you to make your publish branch with only the latest commit. This allows you to make your publish branch with only the latest commit.
```yaml ```yaml
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
with: with:
forceOrphan: true deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./public
force_orphan: true
``` ```
### ⭐️ Set Git username and email ### ⭐️ Set Git username and email
@@ -326,14 +319,12 @@ A commit is always created with the same user.
```yaml ```yaml
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
with: with:
username: "iris" deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
useremail: "iris@peaceiris.com" publish_dir: ./public
user_name: iris
user_email: iris@peaceiris.com
``` ```
### ⭐️ Set custom commit message ### ⭐️ Set custom commit message
@@ -343,13 +334,11 @@ When we create a commit with a message `docs: Update some post`, a deployment co
```yaml ```yaml
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
with: with:
commitMessage: ${{ github.event.head_commit.message }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./public
commit_message: ${{ github.event.head_commit.message }}
``` ```
### ⭐️ Create Git tag ### ⭐️ Create Git tag
@@ -362,35 +351,33 @@ name: github pages
on: on:
push: push:
branches: branches:
- master - master
tags: tags:
- 'v*.*.*' - 'v*.*.*'
jobs: jobs:
build-deploy: deploy:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Some build - name: Some build
- name: Prepare tag - name: Prepare tag
id: prepare_tag id: prepare_tag
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
run: | run: |
TAG_NAME="${GITHUB_REF##refs/tags/}" TAG_NAME="${GITHUB_REF##refs/tags/}"
echo "::set-output name=tag_name::${TAG_NAME}" echo "::set-output name=tag_name::${TAG_NAME}"
echo "::set-output name=deploy_tag_name::deploy-${TAG_NAME}" echo "::set-output name=deploy_tag_name::deploy-${TAG_NAME}"
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env: with:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages publish_dir: ./public
PUBLISH_DIR: ./public tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
with: tag_message: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}'
tagName: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
tagMessage: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}'
``` ```
Commands on a local machine. Commands on a local machine.
@@ -407,28 +394,6 @@ deploy-v1.2.3 # Tag on the gh-pages branch
v1.2.3 # Tag on the master branch v1.2.3 # Tag on the master branch
``` ```
We can set `tagOverwrite` option to `true` for overwriting a tag.
### ⭐️ 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/entrypoint.sh
bash ./entrypoint.sh
```
<div align="right"> <div align="right">
<a href="#table-of-contents">Back to TOC ☝️</a> <a href="#table-of-contents">Back to TOC ☝️</a>
</div> </div>
@@ -466,9 +431,9 @@ Does not your static site generator deal with the static files? No problem, you
### ⭐️ Deployment completed but you cannot read ### ⭐️ Deployment completed but you cannot read
Does your `PUBLISH_DIR` contain files or directories that name starts with an underscore? (`_modules`, `_sources` and `_next`, etc.) Does your `publish_dir` contain files or directories that name starts with an underscore? (`_modules`, `_sources` and `_next`, etc.)
GitHub Pages does not read those by default. GitHub Pages does not read those by default.
Please add `.nojekyll` file to `PUBLISH_DIR`. Please add `.nojekyll` file to `publish_dir`.
- [Bypassing Jekyll on GitHub Pages - The GitHub Blog](https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/) - [Bypassing Jekyll on GitHub Pages - The GitHub Blog](https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/)
@@ -513,37 +478,36 @@ name: github pages
on: on:
push: push:
branches: branches:
- master - master
jobs: jobs:
build-deploy: deploy:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: '10.x' node-version: '10.x'
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.npm path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-node- ${{ runner.os }}-node-
- run: npm ci - run: npm ci
- run: npm run build - run: npm run build
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env: with:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages publish_dir: ./public
PUBLISH_DIR: ./public
``` ```
### ⭐️ Gatsby ### ⭐️ Gatsby
@@ -561,41 +525,40 @@ name: github pages
on: on:
push: push:
branches: branches:
- master - master
jobs: jobs:
build-deploy: deploy:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: '10.x' node-version: '10.x'
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.npm path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-node- ${{ runner.os }}-node-
- run: npm ci - run: npm ci
- run: npm run format - run: npm run format
- run: npm run test - run: npm run test
- run: npm run build - run: npm run build
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env: with:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages publish_dir: ./public
PUBLISH_DIR: ./public
``` ```
### ⭐️ React and Next ### ⭐️ React and Next
@@ -615,45 +578,44 @@ name: github pages
on: on:
push: push:
branches: branches:
- master - master
jobs: jobs:
build-deploy: deploy:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: '10.x' node-version: '10.x'
- name: Get yarn cache - name: Get yarn cache
id: yarn-cache id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ${{ steps.yarn-cache.outputs.dir }} path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-yarn-
- run: yarn install - run: yarn install
- run: yarn build - run: yarn build
- run: yarn export - run: yarn export
- run: touch ./out/.nojekyll - run: touch ./out/.nojekyll
- name: deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env: with:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages publish_dir: ./out
PUBLISH_DIR: ./out
``` ```
### ⭐️ Vue and Nuxt ### ⭐️ Vue and Nuxt
@@ -673,39 +635,38 @@ name: github pages
on: on:
push: push:
branches: branches:
- master - master
jobs: jobs:
build-deploy: deploy:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: '10.x' node-version: '10.x'
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.npm path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-node- ${{ runner.os }}-node-
- run: npm ci - run: npm ci
- run: npm test - run: npm test
- run: npm run generate - run: npm run generate
- name: deploy - name: deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env: with:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages publish_dir: ./dist
PUBLISH_DIR: ./dist
``` ```
### ⭐️ Static Site Generators with Python ### ⭐️ Static Site Generators with Python
@@ -726,41 +687,40 @@ name: github pages
on: on:
push: push:
branches: branches:
- master - master
jobs: jobs:
build-deploy: deploy:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- name: Setup 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 - name: Cache dependencies
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: | restore-keys: |
${{ runner.os }}-pip- ${{ runner.os }}-pip-
- name: Install dependencies - name: Install dependencies
run: | run: |
python3 -m pip install --upgrade pip python3 -m pip install --upgrade pip
python3 -m pip install -r ./requirements.txt python3 -m pip install -r ./requirements.txt
- run: mkdocs build - run: mkdocs build
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env: with:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages publish_dir: ./site
PUBLISH_DIR: ./site
``` ```
### ⭐️ mdBook (Rust) ### ⭐️ mdBook (Rust)
@@ -777,31 +737,27 @@ name: github pages
on: on:
push: push:
branches: branches:
- master - master
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v1 - name: Setup mdBook
with: uses: peaceiris/actions-mdbook@v1
fetch-depth: 1 with:
mdbook-version: '0.3.5'
# mdbook-version: 'latest'
- name: Setup mdBook - run: mdbook build
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.3.5'
# mdbook-version: 'latest'
- run: mdbook build - name: Deploy
uses: peaceiris/actions-gh-pages@v3
- name: Deploy with:
uses: peaceiris/actions-gh-pages@v2 deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
env: publish_dir: ./book
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./book
``` ```
### ⭐️ Flutter Web ### ⭐️ Flutter Web
@@ -825,30 +781,29 @@ on:
- master - master
jobs: jobs:
build-deploy: deploy:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- name: Setup Flutter - name: Setup Flutter
uses: subosito/flutter-action@v1 uses: subosito/flutter-action@v1
with: with:
channel: 'beta' channel: 'beta'
- name: Install - name: Install
run: | run: |
flutter config --enable-web flutter config --enable-web
flutter pub get flutter pub get
- name: Build - name: Build
run: flutter build web run: flutter build web
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env: with:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages publish_dir: ./build/web
PUBLISH_DIR: ./build/web
``` ```
### ⭐️ Elm ### ⭐️ Elm
@@ -867,8 +822,8 @@ on:
- master - master
jobs: jobs:
build-deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -886,11 +841,10 @@ jobs:
# provide --output=<output-file> option for `elm make` and remove this step # provide --output=<output-file> option for `elm make` and remove this step
- name: Deploy - name: Deploy
uses: peaceiris/actions-gh-pages@v2 uses: peaceiris/actions-gh-pages@v3
env: with:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages publish_dir: ./public
PUBLISH_DIR: ./public
``` ```
## License ## License
@@ -901,9 +855,9 @@ jobs:
## About the author ## Maintainer
- [peaceiris's homepage](https://peaceiris.com/) - [peaceiris homepage](https://peaceiris.com/)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 78 KiB

File diff suppressed because it is too large Load Diff

132
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "actions-github-pages", "name": "actions-github-pages",
"version": "3.0.0", "version": "3.1.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -27,15 +27,6 @@
"@octokit/rest": "^16.15.0" "@octokit/rest": "^16.15.0"
} }
}, },
"@actions/glob": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.0.tgz",
"integrity": "sha512-lx8SzyQ2FE9+UUvjqY1f28QbTJv+w8qP7kHHbfQRhphrlcx0Mdmm1tZdGJzfxv1jxREa/sLW4Oy8CbGQKCJySA==",
"requires": {
"@actions/core": "^1.2.0",
"minimatch": "^3.0.4"
}
},
"@actions/http-client": { "@actions/http-client": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.6.tgz", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.6.tgz",
@@ -749,9 +740,9 @@
} }
}, },
"@types/jest": { "@types/jest": {
"version": "25.1.1", "version": "25.1.2",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-25.1.1.tgz", "resolved": "https://registry.npmjs.org/@types/jest/-/jest-25.1.2.tgz",
"integrity": "sha512-bKSZJYZJLzwaoVYNN4W3A0RvKNYsrLm5tsuXaMlfYDxKf4gY2sFrMYneCugNQWGg1gjPW+FHBwNrwPzEi4sIsw==", "integrity": "sha512-EsPIgEsonlXmYV7GzUqcvORsSS9Gqxw/OvkGwHfAdpjduNRxMlhsav0O5Kb0zijc/eXSO/uW6SJt9nwull8AUQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"jest-diff": "^25.1.0", "jest-diff": "^25.1.0",
@@ -765,9 +756,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "13.7.0", "version": "12.12.27",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.0.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.27.tgz",
"integrity": "sha512-GnZbirvmqZUzMgkFn70c74OQpTTUcCzlhQliTzYjQMqg+hVKcDnxdL19Ne3UdYzdMA/+W3eb646FWn/ZaT1NfQ==" "integrity": "sha512-odQFl/+B9idbdS0e8IxDl2ia/LP8KZLXhV3BUeI98TrZp0uoIzQPhGd+5EtzHmT0SMOIaPd7jfz6pOHLWTtl7A=="
}, },
"@types/parse-json": { "@types/parse-json": {
"version": "4.0.0", "version": "4.0.0",
@@ -797,16 +788,50 @@
"dev": true "dev": true
}, },
"@typescript-eslint/eslint-plugin": { "@typescript-eslint/eslint-plugin": {
"version": "2.19.0", "version": "2.20.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.19.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.20.0.tgz",
"integrity": "sha512-u7IcQ9qwsB6U806LupZmINRnQjC+RJyv36sV/ugaFWMHTbFm/hlLTRx3gGYJgHisxcGSTnf+I/fPDieRMhPSQQ==", "integrity": "sha512-cimIdVDV3MakiGJqMXw51Xci6oEDEoPkvh8ggJe2IIzcc0fYqAxOXN6Vbeanahz6dLZq64W+40iUEc9g32FLDQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/experimental-utils": "2.19.0", "@typescript-eslint/experimental-utils": "2.20.0",
"eslint-utils": "^1.4.3", "eslint-utils": "^1.4.3",
"functional-red-black-tree": "^1.0.1", "functional-red-black-tree": "^1.0.1",
"regexpp": "^3.0.0", "regexpp": "^3.0.0",
"tsutils": "^3.17.1" "tsutils": "^3.17.1"
},
"dependencies": {
"@typescript-eslint/experimental-utils": {
"version": "2.20.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.20.0.tgz",
"integrity": "sha512-fEBy9xYrwG9hfBLFEwGW2lKwDRTmYzH3DwTmYbT+SMycmxAoPl0eGretnBFj/s+NfYBG63w/5c3lsvqqz5mYag==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
"@typescript-eslint/typescript-estree": "2.20.0",
"eslint-scope": "^5.0.0"
}
},
"@typescript-eslint/typescript-estree": {
"version": "2.20.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.20.0.tgz",
"integrity": "sha512-WlFk8QtI8pPaE7JGQGxU7nGcnk1ccKAJkhbVookv94ZcAef3m6oCE/jEDL6dGte3JcD7reKrA0o55XhBRiVT3A==",
"dev": true,
"requires": {
"debug": "^4.1.1",
"eslint-visitor-keys": "^1.1.0",
"glob": "^7.1.6",
"is-glob": "^4.0.1",
"lodash": "^4.17.15",
"semver": "^6.3.0",
"tsutils": "^3.17.1"
}
},
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
} }
}, },
"@typescript-eslint/experimental-utils": { "@typescript-eslint/experimental-utils": {
@@ -821,15 +846,49 @@
} }
}, },
"@typescript-eslint/parser": { "@typescript-eslint/parser": {
"version": "2.19.0", "version": "2.20.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.19.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.20.0.tgz",
"integrity": "sha512-s0jZoxAWjHnuidbbN7aA+BFVXn4TCcxEVGPV8lWMxZglSs3NRnFFAlL+aIENNmzB2/1jUJuySi6GiM6uACPmpg==", "integrity": "sha512-o8qsKaosLh2qhMZiHNtaHKTHyCHc3Triq6aMnwnWj7budm3xAY9owSZzV1uon5T9cWmJRJGzTFa90aex4m77Lw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/eslint-visitor-keys": "^1.0.0", "@types/eslint-visitor-keys": "^1.0.0",
"@typescript-eslint/experimental-utils": "2.19.0", "@typescript-eslint/experimental-utils": "2.20.0",
"@typescript-eslint/typescript-estree": "2.19.0", "@typescript-eslint/typescript-estree": "2.20.0",
"eslint-visitor-keys": "^1.1.0" "eslint-visitor-keys": "^1.1.0"
},
"dependencies": {
"@typescript-eslint/experimental-utils": {
"version": "2.20.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.20.0.tgz",
"integrity": "sha512-fEBy9xYrwG9hfBLFEwGW2lKwDRTmYzH3DwTmYbT+SMycmxAoPl0eGretnBFj/s+NfYBG63w/5c3lsvqqz5mYag==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
"@typescript-eslint/typescript-estree": "2.20.0",
"eslint-scope": "^5.0.0"
}
},
"@typescript-eslint/typescript-estree": {
"version": "2.20.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.20.0.tgz",
"integrity": "sha512-WlFk8QtI8pPaE7JGQGxU7nGcnk1ccKAJkhbVookv94ZcAef3m6oCE/jEDL6dGte3JcD7reKrA0o55XhBRiVT3A==",
"dev": true,
"requires": {
"debug": "^4.1.1",
"eslint-visitor-keys": "^1.1.0",
"glob": "^7.1.6",
"is-glob": "^4.0.1",
"lodash": "^4.17.15",
"semver": "^6.3.0",
"tsutils": "^3.17.1"
}
},
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
} }
}, },
"@typescript-eslint/typescript-estree": { "@typescript-eslint/typescript-estree": {
@@ -1136,7 +1195,8 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
}, },
"base": { "base": {
"version": "0.11.2", "version": "0.11.2",
@@ -1217,6 +1277,7 @@
"version": "1.1.11", "version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@@ -1578,7 +1639,8 @@
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
}, },
"concat-stream": { "concat-stream": {
"version": "2.0.0", "version": "2.0.0",
@@ -2323,13 +2385,12 @@
} }
}, },
"eslint-plugin-jest": { "eslint-plugin-jest": {
"version": "23.6.0", "version": "23.7.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.6.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.7.0.tgz",
"integrity": "sha512-GH8AhcFXspOLqak7fqnddLXEJsrFyvgO8Bm60SexvKSn1+3rWYESnCiWUOCUcBTprNSDSE4CtAZdM4EyV6gPPw==", "integrity": "sha512-zkiyGlvJeHNjAEz8FaIxTXNblJJ/zj3waNbYbgflK7K6uy0cpE5zJBt/JpJtOBGM/UGkC6BqsQ4n0y7kQ2HA8w==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/experimental-utils": "^2.5.0", "@typescript-eslint/experimental-utils": "^2.5.0"
"micromatch": "^4.0.2"
} }
}, },
"eslint-scope": { "eslint-scope": {
@@ -3365,9 +3426,9 @@
"dev": true "dev": true
}, },
"husky": { "husky": {
"version": "4.2.1", "version": "4.2.3",
"resolved": "https://registry.npmjs.org/husky/-/husky-4.2.1.tgz", "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.3.tgz",
"integrity": "sha512-Qa0lRreeIf4Tl92sSs42ER6qc3hzoyQPPorzOrFWfPEVbdi6LuvJEqWKPk905fOWIR76iBpp7ECZNIwk+a8xuQ==", "integrity": "sha512-VxTsSTRwYveKXN4SaH1/FefRJYCtx+wx04sSVcOpD7N2zjoHxa+cEJ07Qg5NmV3HAK+IRKOyNVpi2YBIVccIfQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^3.0.0", "chalk": "^3.0.0",
@@ -5265,6 +5326,7 @@
"version": "3.0.4", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "actions-github-pages", "name": "actions-github-pages",
"version": "3.0.0", "version": "3.1.0",
"description": "GitHub Actions for GitHub Pages", "description": "GitHub Actions for GitHub Pages",
"main": "lib/index.js", "main": "lib/index.js",
"engines": { "engines": {
@@ -53,18 +53,17 @@
"@actions/core": "^1.2.2", "@actions/core": "^1.2.2",
"@actions/exec": "^1.0.3", "@actions/exec": "^1.0.3",
"@actions/github": "^2.1.0", "@actions/github": "^2.1.0",
"@actions/glob": "^0.1.0",
"@actions/io": "^1.0.2" "@actions/io": "^1.0.2"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^25.1.1", "@types/jest": "^25.1.2",
"@types/node": "^13.7.0", "@types/node": "~12",
"@typescript-eslint/eslint-plugin": "^2.19.0", "@typescript-eslint/eslint-plugin": "^2.20.0",
"@typescript-eslint/parser": "^2.19.0", "@typescript-eslint/parser": "^2.20.0",
"@zeit/ncc": "^0.21.0", "@zeit/ncc": "^0.21.0",
"eslint": "^6.8.0", "eslint": "^6.8.0",
"eslint-plugin-jest": "^23.6.0", "eslint-plugin-jest": "^23.7.0",
"husky": "^4.2.1", "husky": "^4.2.3",
"jest": "^25.1.0", "jest": "^25.1.0",
"jest-circus": "^25.1.0", "jest-circus": "^25.1.0",
"lint-staged": "^10.0.7", "lint-staged": "^10.0.7",

View File

@@ -3,12 +3,23 @@
# fail on unset variables and command errors # fail on unset variables and command errors
set -eu -o pipefail # -x: is for debugging set -eu -o pipefail # -x: is for debugging
if [ "$(git branch --show-current)" != "master" ]; then CURRENT_BRANCH="$(git branch --show-current)"
echo "$0: Current branch is not master" 1>&2 if [ "${CURRENT_BRANCH}" != "master" ]; then
exit 1 echo "$0: Current branch ${CURRENT_BRANCH} is not master, continue? (y/n)"
read -r res
if [ "${res}" = "n" ]; then
echo "$0: Stop script"
exit 0
fi
fi
PRERELEASE_TYPE_LIST="prerelease prepatch preminor premajor"
if [ "${CURRENT_BRANCH}" != "master" ]; then
RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST}"
else
RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST} patch minor major"
fi fi
RELEASE_TYPE_LIST="prerelease prepatch patch preminor minor major premajor"
if command -v fzf; then if command -v fzf; then
RELEASE_TYPE=$(echo "${RELEASE_TYPE_LIST}" | tr ' ' '\n' | fzf --layout=reverse) RELEASE_TYPE=$(echo "${RELEASE_TYPE_LIST}" | tr ' ' '\n' | fzf --layout=reverse)
else else
@@ -26,9 +37,13 @@ if [ "${res}" = "n" ]; then
fi fi
git fetch origin git fetch origin
git pull origin master if [ "${CURRENT_BRANCH}" != "master" ]; then
git tag -d v3 || true git pull origin "${CURRENT_BRANCH}"
git pull origin --tags else
git pull origin master
git tag -d v3 || true
git pull origin --tags
fi
npm ci npm ci
@@ -43,6 +58,11 @@ git rm ./lib/index.js
rm -rf ./lib rm -rf ./lib
git commit -m "chore(release): Remove build assets [skip ci]" git commit -m "chore(release): Remove build assets [skip ci]"
if [ "${CURRENT_BRANCH}" != "master" ]; then
git push origin "${CURRENT_BRANCH}"
else
git push origin master
fi
TAG_NAME="v$(jq -r '.version' ./package.json)" TAG_NAME="v$(jq -r '.version' ./package.json)"
git push origin master
git push origin "${TAG_NAME}" git push origin "${TAG_NAME}"

View File

@@ -16,7 +16,7 @@ function showInputs(inps: Inputs): void {
core.info(`[INFO] AllowEmptyCommit: ${inps.AllowEmptyCommit}`); core.info(`[INFO] AllowEmptyCommit: ${inps.AllowEmptyCommit}`);
core.info(`[INFO] KeepFiles: ${inps.KeepFiles}`); core.info(`[INFO] KeepFiles: ${inps.KeepFiles}`);
core.info(`[INFO] ForceOrphan: ${inps.ForceOrphan}`); core.info(`[INFO] ForceOrphan: ${inps.ForceOrphan}`);
core.info(`[INFO] UserEmail: ${inps.UserEmail}`); core.info(`[INFO] UserName: ${inps.UserName}`);
core.info(`[INFO] UserEmail: ${inps.UserEmail}`); core.info(`[INFO] UserEmail: ${inps.UserEmail}`);
core.info(`[INFO] CommitMessage: ${inps.CommitMessage}`); core.info(`[INFO] CommitMessage: ${inps.CommitMessage}`);
core.info(`[INFO] TagName: ${inps.TagName}`); core.info(`[INFO] TagName: ${inps.TagName}`);

View File

@@ -2,8 +2,8 @@ import * as core from '@actions/core';
import * as exec from '@actions/exec'; import * as exec from '@actions/exec';
import * as github from '@actions/github'; import * as github from '@actions/github';
import * as io from '@actions/io'; import * as io from '@actions/io';
import * as glob from '@actions/glob';
import path from 'path'; import path from 'path';
import fs from 'fs';
import {Inputs, CmdResult} from './interfaces'; import {Inputs, CmdResult} from './interfaces';
import {getHomeDir} from './utils'; import {getHomeDir} from './utils';
@@ -23,21 +23,27 @@ export async function copyAssets(
publishDir: string, publishDir: string,
workDir: string workDir: string
): Promise<void> { ): Promise<void> {
const copyOpts = {recursive: true, force: false}; const copyOpts = {recursive: true, force: true};
const globber = await glob.create(`${publishDir}/*`); const files = fs.readdirSync(publishDir);
for await (const file of globber.globGenerator()) { core.debug(`${files}`);
for await (const file of files) {
if (file.endsWith('.git') || file.endsWith('.github')) { if (file.endsWith('.git') || file.endsWith('.github')) {
continue; continue;
} }
await io.cp(file, `${workDir}/`, copyOpts); const filePath = path.join(publishDir, file);
await io.cp(filePath, `${workDir}/`, copyOpts);
core.info(`[INFO] copy ${file}`); core.info(`[INFO] copy ${file}`);
} }
return; return;
} }
export async function setRepo(inps: Inputs, remoteURL: string): Promise<void> { export async function setRepo(
const workDir = path.join(getHomeDir(), 'actions_github_pages'); inps: Inputs,
remoteURL: string,
unixTime: string
): Promise<void> {
const workDir = path.join(getHomeDir(), `actions_github_pages_${unixTime}`);
const publishDir = path.join( const publishDir = path.join(
`${process.env.GITHUB_WORKSPACE}`, `${process.env.GITHUB_WORKSPACE}`,
inps.PublishDir inps.PublishDir
@@ -63,36 +69,41 @@ export async function setRepo(inps: Inputs, remoteURL: string): Promise<void> {
} }
} }
}; };
result.exitcode = await exec.exec(
'git',
[
'clone',
'--depth=1',
'--single-branch',
'--branch',
inps.PublishBranch,
remoteURL,
workDir
],
options
);
process.chdir(workDir); try {
result.exitcode = await exec.exec(
'git',
[
'clone',
'--depth=1',
'--single-branch',
'--branch',
inps.PublishBranch,
remoteURL,
workDir
],
options
);
if (result.exitcode === 0) {
process.chdir(workDir);
if (inps.KeepFiles) {
core.info('[INFO] Keep existing files');
} else {
await exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
}
if (result.exitcode === 0) { await copyAssets(publishDir, workDir);
if (inps.KeepFiles) { return;
core.info('[INFO] Keep existing files');
} else { } else {
await exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']); throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
} }
} catch (e) {
await copyAssets(publishDir, workDir);
return;
} else {
core.info( core.info(
`[INFO] first deployment, create new branch ${inps.PublishBranch}` `[INFO] first deployment, create new branch ${inps.PublishBranch}`
); );
core.info(e);
await createWorkDir(workDir); await createWorkDir(workDir);
process.chdir(workDir);
await createBranchForce(inps.PublishBranch); await createBranchForce(inps.PublishBranch);
await copyAssets(publishDir, workDir); await copyAssets(publishDir, workDir);
return; return;

View File

@@ -12,9 +12,11 @@ export async function run(): Promise<void> {
await git.setConfig(inps.UserName, inps.UserEmail); await git.setConfig(inps.UserName, inps.UserEmail);
const remoteURL = await setTokens(inps); const remoteURL = await setTokens(inps);
core.info(`[INFO] remoteURL: ${remoteURL}`); // TODO: remove core.debug(`[INFO] remoteURL: ${remoteURL}`);
await git.setRepo(inps, remoteURL); const date = new Date();
const unixTime = date.getTime();
await git.setRepo(inps, remoteURL, `${unixTime}`);
try { try {
await exec.exec('git', ['remote', 'rm', 'origin']); await exec.exec('git', ['remote', 'rm', 'origin']);
@@ -31,7 +33,8 @@ export async function run(): Promise<void> {
); );
await git.push(inps.PublishBranch, inps.ForceOrphan); await git.push(inps.PublishBranch, inps.ForceOrphan);
await git.pushTag(inps.TagName, inps.TagMessage); await git.pushTag(inps.TagName, inps.TagMessage);
core.info('[INFO] successfully deployed');
core.info('[INFO] Action successfully completed');
return; return;
} catch (e) { } catch (e) {

View File

@@ -4,8 +4,10 @@ import * as github from '@actions/github';
import * as io from '@actions/io'; import * as io from '@actions/io';
import path from 'path'; import path from 'path';
import fs from 'fs'; import fs from 'fs';
const cpSpawnSync = require('child_process').spawnSync;
const cpexec = require('child_process').execFileSync; const cpexec = require('child_process').execFileSync;
import {Inputs} from './interfaces'; import {Inputs} from './interfaces';
import {getHomeDir} from './utils';
export function setPublishRepo(insp: Inputs): string { export function setPublishRepo(insp: Inputs): string {
if (insp.ExternalRepository) { if (insp.ExternalRepository) {
@@ -20,7 +22,8 @@ export async function setSSHKey(
): Promise<string> { ): Promise<string> {
core.info('[INFO] setup SSH deploy key'); core.info('[INFO] setup SSH deploy key');
const sshDir = path.join(`${process.env.HOME}`, '.ssh'); const homeDir = getHomeDir();
const sshDir = path.join(homeDir, '.ssh');
await io.mkdirP(sshDir); await io.mkdirP(sshDir);
await exec.exec('chmod', ['700', sshDir]); await exec.exec('chmod', ['700', sshDir]);
@@ -50,6 +53,12 @@ Host github
core.info(`[INFO] wrote ${sshConfigPath}`); core.info(`[INFO] wrote ${sshConfigPath}`);
await exec.exec('chmod', ['600', sshConfigPath]); await exec.exec('chmod', ['600', sshConfigPath]);
if (process.platform === 'win32') {
await cpSpawnSync('Start-Process', ['powershell.exe', '-Verb', 'runas']);
await cpSpawnSync('sh', ['-c', '\'eval "$(ssh-agent)"\''], {shell: true});
await exec.exec('sc', ['config', 'ssh-agent', 'start=auto']);
await exec.exec('sc', ['start', 'ssh-agent']);
}
await cpexec('ssh-agent', ['-a', '/tmp/ssh-auth.sock']); await cpexec('ssh-agent', ['-a', '/tmp/ssh-auth.sock']);
core.exportVariable('SSH_AUTH_SOCK', '/tmp/ssh-auth.sock'); core.exportVariable('SSH_AUTH_SOCK', '/tmp/ssh-auth.sock');
await exec.exec('ssh-add', [idRSA]); await exec.exec('ssh-add', [idRSA]);
@@ -78,9 +87,6 @@ export async function setGithubToken(
`You deploy from ${inps.PublishBranch} to ${inps.PublishBranch}` `You deploy from ${inps.PublishBranch} to ${inps.PublishBranch}`
); );
} }
} else if (context.eventName === 'pull_request') {
// TODO: support pull_request event
throw new Error('This action does not support pull_request event now.');
} }
const isPrivateRepository = payload.repository?.private; const isPrivateRepository = payload.repository?.private;