Compare commits
104 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbdfb20061 | ||
|
|
7fd2e42a05 | ||
|
|
e93eed3ba7 | ||
|
|
cf805b9457 | ||
|
|
c4241b26fb | ||
|
|
4f6b15a24f | ||
|
|
42954117ce | ||
|
|
48b33dca85 | ||
|
|
45bd46f922 | ||
|
|
95792e1c0f | ||
|
|
66acd31e22 | ||
|
|
31256664b6 | ||
|
|
e90f765da6 | ||
|
|
725f7db867 | ||
|
|
46b269eb77 | ||
|
|
572a9b5eb9 | ||
|
|
d81433ecbd | ||
|
|
a284cb02e9 | ||
|
|
4682881fa3 | ||
|
|
9765b50692 | ||
|
|
772c200ac1 | ||
|
|
25e5ffa147 | ||
|
|
144799313d | ||
|
|
87e03f1be4 | ||
|
|
c77e4d0f87 | ||
|
|
5c575e8b27 | ||
|
|
1a9f7eb481 | ||
|
|
c6c5feba5e | ||
|
|
edd5ff366e | ||
|
|
f15a311467 | ||
|
|
274c177da0 | ||
|
|
24f34b2d74 | ||
|
|
a60f4671fe | ||
|
|
b3747cde80 | ||
|
|
04aa727212 | ||
|
|
3bdd7da7d7 | ||
|
|
f679a0dbd1 | ||
|
|
c41db76534 | ||
|
|
2cddccc8c3 | ||
|
|
cb130c640d | ||
|
|
3b4c9db644 | ||
|
|
803227f54b | ||
|
|
c1c219f526 | ||
|
|
b4f6cbe8b1 | ||
|
|
9cb40f4ee9 | ||
|
|
31a25da109 | ||
|
|
120ec442c1 | ||
|
|
e399650661 | ||
|
|
edfebaf01b | ||
|
|
9fba4cf667 | ||
|
|
9c2e2dd3ce | ||
|
|
e5f4a9361d | ||
|
|
2a142a0e74 | ||
|
|
abae70beb5 | ||
|
|
fe21b422bf | ||
|
|
0b2e6b45b9 | ||
|
|
c96473bb55 | ||
|
|
913650d45b | ||
|
|
82c33532d4 | ||
|
|
45708a0373 | ||
|
|
def0f6b635 | ||
|
|
b00ccd8065 | ||
|
|
afac56dcec | ||
|
|
f3be898a96 | ||
|
|
457c86c44a | ||
|
|
b9e600fd62 | ||
|
|
f89d8688b5 | ||
|
|
0762b5c9b9 | ||
|
|
c1ee410019 | ||
|
|
c04664fa6b | ||
|
|
b5c306f7ff | ||
|
|
50d8ed5bb6 | ||
|
|
d874503733 | ||
|
|
8955511f50 | ||
|
|
f034a3f485 | ||
|
|
c20c670c27 | ||
|
|
5a84f48f78 | ||
|
|
67200cfb5a | ||
|
|
37b07f70e3 | ||
|
|
48392f0c0c | ||
|
|
548761031c | ||
|
|
79bf213729 | ||
|
|
a1d6c2131c | ||
|
|
f74f5a30da | ||
|
|
fb9ff7fb2e | ||
|
|
16beda69bf | ||
|
|
a6d0886173 | ||
|
|
8146aedaa9 | ||
|
|
7af7235a08 | ||
|
|
42cf99685e | ||
|
|
74041e385e | ||
|
|
1f2df4a7dd | ||
|
|
61e2a61aea | ||
|
|
d7934f1bfb | ||
|
|
25119e64f4 | ||
|
|
05a7c4edd9 | ||
|
|
4c2d9ecb85 | ||
|
|
6b302fdd50 | ||
|
|
f80024481c | ||
|
|
ba912f746b | ||
|
|
02db90c5c8 | ||
|
|
b5599b36fd | ||
|
|
3f71ec211a | ||
|
|
5bfcd3f213 |
35
.devcontainer/devcontainer.json
Normal file
35
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "Node.js",
|
||||||
|
"image": "docker.pkg.github.com/peaceiris/actions-gh-pages/dev:latest",
|
||||||
|
|
||||||
|
// Use 'settings' to set *default* container specific settings.json values on container create.
|
||||||
|
"settings": {
|
||||||
|
"terminal.integrated.shell.linux": "/bin/bash"
|
||||||
|
},
|
||||||
|
|
||||||
|
// Add the IDs of extensions you want installed when the container is created in the array below.
|
||||||
|
"extensions": [
|
||||||
|
"bungcip.better-toml",
|
||||||
|
"EditorConfig.EditorConfig",
|
||||||
|
"donjayamanne.githistory",
|
||||||
|
"eamodio.gitlens",
|
||||||
|
"oderwat.indent-rainbow",
|
||||||
|
"yzhang.markdown-all-in-one",
|
||||||
|
"shd101wyy.markdown-preview-enhanced",
|
||||||
|
"christian-kohler.path-intellisense",
|
||||||
|
"lfs.vscode-emacs-friendly",
|
||||||
|
"ms-azuretools.vscode-docker",
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"firsttris.vscode-jest-runner",
|
||||||
|
"VisualStudioExptTeam.vscodeintellicode"
|
||||||
|
],
|
||||||
|
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
// "forwardPorts": [3000],
|
||||||
|
|
||||||
|
// Specifies a command that should be run after the container has been created.
|
||||||
|
"postCreateCommand": "npm ci",
|
||||||
|
|
||||||
|
// Comment out the next line to run as root instead.
|
||||||
|
// "remoteUser": "runner"
|
||||||
|
}
|
||||||
7
.github/dependabot.yml
vendored
7
.github/dependabot.yml
vendored
@@ -8,11 +8,8 @@ updates:
|
|||||||
timezone: Japan
|
timezone: Japan
|
||||||
labels:
|
labels:
|
||||||
- dependencies
|
- dependencies
|
||||||
ignore:
|
allow:
|
||||||
- dependency-name: "@types/node"
|
- dependency-type: "production"
|
||||||
versions:
|
|
||||||
- ">= 13.a, < 14"
|
|
||||||
- ">= 14.a, < 15"
|
|
||||||
commit-message:
|
commit-message:
|
||||||
prefix: deps
|
prefix: deps
|
||||||
|
|
||||||
|
|||||||
23
.github/workflows/release.yml
vendored
23
.github/workflows/release.yml
vendored
@@ -10,27 +10,6 @@ jobs:
|
|||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.1
|
- uses: actions/checkout@v2.3.1
|
||||||
|
- uses: peaceiris/workflows/create-release-npm@v0.7.0
|
||||||
- name: Dump GitHub context
|
|
||||||
env:
|
|
||||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
||||||
run: echo "${GITHUB_CONTEXT}"
|
|
||||||
|
|
||||||
- name: Install github/hub
|
|
||||||
run: |
|
|
||||||
export HUB_VERSION="2.14.2"
|
|
||||||
curl -fsSL https://github.com/github/hub/raw/8d91904208171b013f9a9d1175f4ab39068db047/script/get | bash -s "${HUB_VERSION}"
|
|
||||||
|
|
||||||
- name: Create release
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
|
||||||
TAG_NAME="${GITHUB_REF##refs/tags/}"
|
|
||||||
echo "See [CHANGELOG.md](https://github.com/${GITHUB_REPOSITORY}/blob/${TAG_NAME}/CHANGELOG.md) for more details." > ./release_notes.md
|
|
||||||
RELEASE_NAME="$(jq -r '.name' ./package.json)"
|
|
||||||
sed -i "1i${RELEASE_NAME} ${TAG_NAME}\n" ./release_notes.md
|
|
||||||
./bin/hub release create \
|
|
||||||
--draft \
|
|
||||||
--prerelease \
|
|
||||||
--file ./release_notes.md \
|
|
||||||
"${TAG_NAME}"
|
|
||||||
|
|||||||
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
|||||||
id: nvm
|
id: nvm
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v2.1.1
|
uses: actions/setup-node@v2.1.2
|
||||||
with:
|
with:
|
||||||
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ jobs:
|
|||||||
name: coverage-${{ matrix.os }}
|
name: coverage-${{ matrix.os }}
|
||||||
path: coverage
|
path: coverage
|
||||||
|
|
||||||
- uses: codecov/codecov-action@v1.0.12
|
- uses: codecov/codecov-action@v1.0.14
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup mdBook
|
- name: Setup mdBook
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
uses: peaceiris/actions-mdbook@v1.1.12
|
uses: peaceiris/actions-mdbook@v1.1.13
|
||||||
with:
|
with:
|
||||||
mdbook-version: '0.3.7'
|
mdbook-version: '0.3.7'
|
||||||
|
|
||||||
|
|||||||
2
.prettierignore
Normal file
2
.prettierignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
lib/
|
||||||
171
CHANGELOG.md
171
CHANGELOG.md
@@ -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.7.3](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.2...v3.7.3) (2020-10-20)
|
||||||
|
|
||||||
|
|
||||||
|
### ci
|
||||||
|
|
||||||
|
* bump codecov/codecov-action from v1.0.13 to v1.0.14 (#526) ([c4241b2](https://github.com/peaceiris/actions-gh-pages/commit/c4241b26fb90917901c95fabafc9907f71f44508)), closes [#526](https://github.com/peaceiris/actions-gh-pages/issues/526)
|
||||||
|
|
||||||
|
### docs
|
||||||
|
|
||||||
|
* Add link to create-react-app (#525) ([cf805b9](https://github.com/peaceiris/actions-gh-pages/commit/cf805b9457df587d349ee1684a4801cf9bbaac7d)), closes [#525](https://github.com/peaceiris/actions-gh-pages/issues/525)
|
||||||
|
|
||||||
|
### fix
|
||||||
|
|
||||||
|
* copyAssets and deleteExcludedAssets (#528) ([e93eed3](https://github.com/peaceiris/actions-gh-pages/commit/e93eed3ba7edf10f461bc4a7bd14cd2a12f44935)), closes [#528](https://github.com/peaceiris/actions-gh-pages/issues/528)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [3.7.2](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.1...v3.7.2) (2020-10-15)
|
||||||
|
|
||||||
|
|
||||||
|
### ci
|
||||||
|
|
||||||
|
* peaceiris/workflows/create-release-npm@v0.7.0 ([45bd46f](https://github.com/peaceiris/actions-gh-pages/commit/45bd46f92200c682e8e4a5d0f542aa12f9417131))
|
||||||
|
|
||||||
|
### fix
|
||||||
|
|
||||||
|
* copy dotfiles (#521) ([95792e1](https://github.com/peaceiris/actions-gh-pages/commit/95792e1c0fe9dfef8ebe7284d1af7ca787fde866)), closes [#521](https://github.com/peaceiris/actions-gh-pages/issues/521) [#520](https://github.com/peaceiris/actions-gh-pages/issues/520) [#512](https://github.com/peaceiris/actions-gh-pages/issues/512) [#507](https://github.com/peaceiris/actions-gh-pages/issues/507) [#509](https://github.com/peaceiris/actions-gh-pages/issues/509) [#390](https://github.com/peaceiris/actions-gh-pages/issues/390) [#324](https://github.com/peaceiris/actions-gh-pages/issues/324) [#103](https://github.com/peaceiris/actions-gh-pages/issues/103)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [3.7.1](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0...v3.7.1) (2020-10-14)
|
||||||
|
|
||||||
|
|
||||||
|
### chore
|
||||||
|
|
||||||
|
* add .prettierignore ([772c200](https://github.com/peaceiris/actions-gh-pages/commit/772c200ac146a7e8d63c227a919456f8e0b4693f))
|
||||||
|
|
||||||
|
### ci
|
||||||
|
|
||||||
|
* allow dependency-type production (#518) ([572a9b5](https://github.com/peaceiris/actions-gh-pages/commit/572a9b5eb96036fc7a15f7edc15612d6889f9cfa)), closes [#518](https://github.com/peaceiris/actions-gh-pages/issues/518)
|
||||||
|
|
||||||
|
### deps
|
||||||
|
|
||||||
|
* bump @types/node from 12.12.63 to 12.12.64 (#506) ([a60f467](https://github.com/peaceiris/actions-gh-pages/commit/a60f4671feb4a666aab43d6ac5a3783dc4657a43)), closes [#506](https://github.com/peaceiris/actions-gh-pages/issues/506)
|
||||||
|
* bump @types/node from 12.12.64 to 12.12.66 (#508) ([5c575e8](https://github.com/peaceiris/actions-gh-pages/commit/5c575e8b276eea8921774c99a7b83c0d66cea90a)), closes [#508](https://github.com/peaceiris/actions-gh-pages/issues/508)
|
||||||
|
* bump @types/node from 12.12.66 to 12.12.67 (#511) ([1447993](https://github.com/peaceiris/actions-gh-pages/commit/144799313d4ad48903ce4729920e3d2f1429bbeb)), closes [#511](https://github.com/peaceiris/actions-gh-pages/issues/511)
|
||||||
|
* bump jest from 26.5.0 to 26.5.2 (#504) ([24f34b2](https://github.com/peaceiris/actions-gh-pages/commit/24f34b2d740cd79924d8a98bb8f26576309eeced)), closes [#504](https://github.com/peaceiris/actions-gh-pages/issues/504)
|
||||||
|
* bump jest from 26.5.2 to 26.5.3 (#515) ([a284cb0](https://github.com/peaceiris/actions-gh-pages/commit/a284cb02e9b796754ca6b5c8471b228ec8c6958e)), closes [#515](https://github.com/peaceiris/actions-gh-pages/issues/515)
|
||||||
|
* bump jest-circus from 26.5.1 to 26.5.2 (#505) ([274c177](https://github.com/peaceiris/actions-gh-pages/commit/274c177da0a2ff2cfe592e6b36c355f8bc062be5)), closes [#505](https://github.com/peaceiris/actions-gh-pages/issues/505)
|
||||||
|
* bump jest-circus from 26.5.2 to 26.5.3 (#516) ([9765b50](https://github.com/peaceiris/actions-gh-pages/commit/9765b50692abbd7b95c1c097da071f5a9c98804d)), closes [#516](https://github.com/peaceiris/actions-gh-pages/issues/516)
|
||||||
|
* bump node from 12.18.4 to 12.19.0 (#510) ([87e03f1](https://github.com/peaceiris/actions-gh-pages/commit/87e03f1be4c6673e544b6a89259729c5c646cdf6)), closes [#510](https://github.com/peaceiris/actions-gh-pages/issues/510)
|
||||||
|
* update (#517) ([d81433e](https://github.com/peaceiris/actions-gh-pages/commit/d81433ecbd529e53bb1201223120e2febf24b310)), closes [#517](https://github.com/peaceiris/actions-gh-pages/issues/517)
|
||||||
|
|
||||||
|
### docs
|
||||||
|
|
||||||
|
* add notes about keep_files ([c77e4d0](https://github.com/peaceiris/actions-gh-pages/commit/c77e4d0f87024d01904cc067c1a8b8affd80c1f7)), closes [#507](https://github.com/peaceiris/actions-gh-pages/issues/507) [#509](https://github.com/peaceiris/actions-gh-pages/issues/509)
|
||||||
|
* pin version to v3 ([b3747cd](https://github.com/peaceiris/actions-gh-pages/commit/b3747cde802bb259e2c13135ae1f36d309bd3808))
|
||||||
|
* remove link to #349 ([1a9f7eb](https://github.com/peaceiris/actions-gh-pages/commit/1a9f7eb4817f70390ed147b00fdf4b7284cd913d)), closes [#349](https://github.com/peaceiris/actions-gh-pages/issues/349)
|
||||||
|
* update exclude_assets ([4682881](https://github.com/peaceiris/actions-gh-pages/commit/4682881fa3a4b9f5a25027d6bf1b47f6d6fda5e9))
|
||||||
|
* update Flutter Web ([edd5ff3](https://github.com/peaceiris/actions-gh-pages/commit/edd5ff366e489149e15c36cfe923b1d71953b7a7))
|
||||||
|
* update Swift Publish ([c6c5feb](https://github.com/peaceiris/actions-gh-pages/commit/c6c5feba5e7cdf1e9227296b38c6ab27a6372304))
|
||||||
|
* update Swift Publish ([f15a311](https://github.com/peaceiris/actions-gh-pages/commit/f15a3114676f95a60146c8270e93a3ddd2c03086))
|
||||||
|
* update title position ([46b269e](https://github.com/peaceiris/actions-gh-pages/commit/46b269eb77e5fe6f2fc9c9cc531541227dfeca22))
|
||||||
|
|
||||||
|
### feat
|
||||||
|
|
||||||
|
* Add link to README in log ([25e5ffa](https://github.com/peaceiris/actions-gh-pages/commit/25e5ffa1476a0017af4dfa0feb054ac18ccd1797))
|
||||||
|
|
||||||
|
### fix
|
||||||
|
|
||||||
|
* copyAssets (#512) ([725f7db](https://github.com/peaceiris/actions-gh-pages/commit/725f7db867bb4bb443f5d8bdffb18297aab5e5a3)), closes [#512](https://github.com/peaceiris/actions-gh-pages/issues/512)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [3.7.0](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0-8...v3.7.0) (2020-10-06)
|
||||||
|
|
||||||
|
|
||||||
|
### chore
|
||||||
|
|
||||||
|
* add ms-azuretools.vscode-docker ([b5c306f](https://github.com/peaceiris/actions-gh-pages/commit/b5c306f7ffdc59a10e5731919fd1b53b2f31d08b))
|
||||||
|
|
||||||
|
### ci
|
||||||
|
|
||||||
|
* bump actions/setup-node from v2.1.1 to v2.1.2 (#496) ([c1c219f](https://github.com/peaceiris/actions-gh-pages/commit/c1c219f526155987550e06bedfcc8e2fcc34f19b)), closes [#496](https://github.com/peaceiris/actions-gh-pages/issues/496)
|
||||||
|
* bump codecov/codecov-action from v1.0.12 to v1.0.13 (#454) ([16beda6](https://github.com/peaceiris/actions-gh-pages/commit/16beda69bf1c2971147330f49aaed617dcd38a2c)), closes [#454](https://github.com/peaceiris/actions-gh-pages/issues/454)
|
||||||
|
* bump peaceiris/actions-mdbook from v1.1.12 to v1.1.13 (#503) ([c41db76](https://github.com/peaceiris/actions-gh-pages/commit/c41db7653434f02391fb62fd0b3a1392c96e0f3a)), closes [#503](https://github.com/peaceiris/actions-gh-pages/issues/503)
|
||||||
|
|
||||||
|
### deps
|
||||||
|
|
||||||
|
* bump @actions/core from 1.2.4 to 1.2.5 (#464) ([f034a3f](https://github.com/peaceiris/actions-gh-pages/commit/f034a3f4851fe530b19b0413e95e6dc9f6651cac)), closes [#464](https://github.com/peaceiris/actions-gh-pages/issues/464)
|
||||||
|
* bump @actions/core from 1.2.5 to 1.2.6 (#493) ([31a25da](https://github.com/peaceiris/actions-gh-pages/commit/31a25da1090b19d7964d43a4999bbcac970cabc2)), closes [#493](https://github.com/peaceiris/actions-gh-pages/issues/493)
|
||||||
|
* bump @types/jest from 26.0.10 to 26.0.12 (#469) ([50d8ed5](https://github.com/peaceiris/actions-gh-pages/commit/50d8ed5bb609b910779ba8fb2be482988b1b2715)), closes [#469](https://github.com/peaceiris/actions-gh-pages/issues/469)
|
||||||
|
* bump @types/jest from 26.0.12 to 26.0.13 (#472) ([c1ee410](https://github.com/peaceiris/actions-gh-pages/commit/c1ee41001942b9ad1cab043438839698182a8e36)), closes [#472](https://github.com/peaceiris/actions-gh-pages/issues/472)
|
||||||
|
* bump @types/jest from 26.0.13 to 26.0.14 (#487) ([e5f4a93](https://github.com/peaceiris/actions-gh-pages/commit/e5f4a9361dc7a7fcf85bc93cdda63498b5b2675a)), closes [#487](https://github.com/peaceiris/actions-gh-pages/issues/487)
|
||||||
|
* bump @types/jest from 26.0.9 to 26.0.10 (#452) ([a6d0886](https://github.com/peaceiris/actions-gh-pages/commit/a6d08861738e12d61a6165e91744ad47ec5055c8)), closes [#452](https://github.com/peaceiris/actions-gh-pages/issues/452)
|
||||||
|
* bump @types/js-yaml from 3.12.4 to 3.12.5 (#369) ([b9e600f](https://github.com/peaceiris/actions-gh-pages/commit/b9e600fd62e1b00b9bece7bb97364b5e2851bde8)), closes [#369](https://github.com/peaceiris/actions-gh-pages/issues/369)
|
||||||
|
* bump @types/node from 12.12.54 to 12.12.55 (#471) ([c04664f](https://github.com/peaceiris/actions-gh-pages/commit/c04664fa6b9c7976cb163f63bf3eeadb89dc5d35)), closes [#471](https://github.com/peaceiris/actions-gh-pages/issues/471)
|
||||||
|
* bump @types/node from 12.12.55 to 12.12.56 (#477) ([b00ccd8](https://github.com/peaceiris/actions-gh-pages/commit/b00ccd8065e8b7492a736dc24ab492edd78c4d94)), closes [#477](https://github.com/peaceiris/actions-gh-pages/issues/477)
|
||||||
|
* bump @types/node from 12.12.56 to 12.12.57 (#478) ([def0f6b](https://github.com/peaceiris/actions-gh-pages/commit/def0f6b6353a5f7375d8883fab8ba2a31aae4dde)), closes [#478](https://github.com/peaceiris/actions-gh-pages/issues/478)
|
||||||
|
* bump @types/node from 12.12.57 to 12.12.58 (#480) ([82c3353](https://github.com/peaceiris/actions-gh-pages/commit/82c33532d47c1e3e1022768837fe72240e14df4e)), closes [#480](https://github.com/peaceiris/actions-gh-pages/issues/480)
|
||||||
|
* bump @types/node from 12.12.58 to 12.12.59 (#484) ([0b2e6b4](https://github.com/peaceiris/actions-gh-pages/commit/0b2e6b45b9742859757becb0e32d2dac9603ae8b)), closes [#484](https://github.com/peaceiris/actions-gh-pages/issues/484)
|
||||||
|
* bump @types/node from 12.12.59 to 12.12.61 (#486) ([2a142a0](https://github.com/peaceiris/actions-gh-pages/commit/2a142a0e742af73091ee341d3a16e417831d2ade)), closes [#486](https://github.com/peaceiris/actions-gh-pages/issues/486)
|
||||||
|
* bump @types/node from 12.12.61 to 12.12.62 (#488) ([9c2e2dd](https://github.com/peaceiris/actions-gh-pages/commit/9c2e2dd3cef54dcc19cbf40f9e82d565a0e0958a)), closes [#488](https://github.com/peaceiris/actions-gh-pages/issues/488)
|
||||||
|
* bump @types/node from 12.12.62 to 12.12.63 (#499) ([803227f](https://github.com/peaceiris/actions-gh-pages/commit/803227f54b5889f9da91766b49c882a8f1757188)), closes [#499](https://github.com/peaceiris/actions-gh-pages/issues/499)
|
||||||
|
* bump @vercel/ncc from 0.23.0 to 0.24.0 (#466) ([c20c670](https://github.com/peaceiris/actions-gh-pages/commit/c20c670c27d0e3057e45943f483bd0065f6041c8)), closes [#466](https://github.com/peaceiris/actions-gh-pages/issues/466)
|
||||||
|
* bump @vercel/ncc from 0.24.0 to 0.24.1 (#482) ([c96473b](https://github.com/peaceiris/actions-gh-pages/commit/c96473bb55710193901822a1ff27f6832eb72088)), closes [#482](https://github.com/peaceiris/actions-gh-pages/issues/482)
|
||||||
|
* bump eslint-config-prettier from 6.11.0 to 6.12.0 (#494) ([9cb40f4](https://github.com/peaceiris/actions-gh-pages/commit/9cb40f4ee908941ea49e90aff1ad48df306fcc38)), closes [#494](https://github.com/peaceiris/actions-gh-pages/issues/494)
|
||||||
|
* bump eslint-plugin-jest from 23.20.0 to 24.0.0 (#474) ([457c86c](https://github.com/peaceiris/actions-gh-pages/commit/457c86c44a39d04fbdcb8689e2f7672171751c58)), closes [#474](https://github.com/peaceiris/actions-gh-pages/issues/474)
|
||||||
|
* bump eslint-plugin-jest from 24.0.0 to 24.0.1 (#481) ([913650d](https://github.com/peaceiris/actions-gh-pages/commit/913650d45b7f1ea255cb5ff4b56dbe9c7b07a2ca)), closes [#481](https://github.com/peaceiris/actions-gh-pages/issues/481)
|
||||||
|
* bump eslint-plugin-jest from 24.0.1 to 24.0.2 (#491) ([e399650](https://github.com/peaceiris/actions-gh-pages/commit/e3996506619cae3bd515e7465c8dd5061c206101)), closes [#491](https://github.com/peaceiris/actions-gh-pages/issues/491)
|
||||||
|
* bump eslint-plugin-jest from 24.0.2 to 24.1.0 (#501) ([cb130c6](https://github.com/peaceiris/actions-gh-pages/commit/cb130c640dd2b2db834221575f347c93197363f0)), closes [#501](https://github.com/peaceiris/actions-gh-pages/issues/501)
|
||||||
|
* bump husky from 4.2.5 to 4.3.0 (#475) ([afac56d](https://github.com/peaceiris/actions-gh-pages/commit/afac56dcec4acb0a3c4bdcee799b2d5e6a582c99)), closes [#475](https://github.com/peaceiris/actions-gh-pages/issues/475)
|
||||||
|
* bump jest from 25.5.4 to 26.3.0 (#447) ([1f2df4a](https://github.com/peaceiris/actions-gh-pages/commit/1f2df4a7dd60e855bfd97162973852d897887c7a)), closes [#447](https://github.com/peaceiris/actions-gh-pages/issues/447)
|
||||||
|
* bump jest from 26.3.0 to 26.4.0 (#450) ([7af7235](https://github.com/peaceiris/actions-gh-pages/commit/7af7235a08b063929bd7e0c55498c7bf5b21f73f)), closes [#450](https://github.com/peaceiris/actions-gh-pages/issues/450)
|
||||||
|
* bump jest from 26.4.0 to 26.4.1 (#457) ([a1d6c21](https://github.com/peaceiris/actions-gh-pages/commit/a1d6c2131c75b416675be135a52a998a17923d86)), closes [#457](https://github.com/peaceiris/actions-gh-pages/issues/457)
|
||||||
|
* bump jest from 26.4.1 to 26.4.2 (#461) ([48392f0](https://github.com/peaceiris/actions-gh-pages/commit/48392f0c0cacab183ba360172d795ea0517c5b52)), closes [#461](https://github.com/peaceiris/actions-gh-pages/issues/461)
|
||||||
|
* bump jest from 26.4.2 to 26.5.0 (#500) ([3b4c9db](https://github.com/peaceiris/actions-gh-pages/commit/3b4c9db6447ee157aacdda858a7012007f285b26)), closes [#500](https://github.com/peaceiris/actions-gh-pages/issues/500)
|
||||||
|
* bump jest-circus from 26.2.2 to 26.3.0 (#446) ([61e2a61](https://github.com/peaceiris/actions-gh-pages/commit/61e2a61aea18b6db8407f51f442a89c30b0a4b16)), closes [#446](https://github.com/peaceiris/actions-gh-pages/issues/446)
|
||||||
|
* bump jest-circus from 26.3.0 to 26.4.0 (#449) ([74041e3](https://github.com/peaceiris/actions-gh-pages/commit/74041e385e8c91588c923bb9a9dad5e0c675dc10)), closes [#449](https://github.com/peaceiris/actions-gh-pages/issues/449)
|
||||||
|
* bump jest-circus from 26.4.0 to 26.4.1 (#458) ([f74f5a3](https://github.com/peaceiris/actions-gh-pages/commit/f74f5a30da4f78a3cfec43fbe471308d45252fb9)), closes [#458](https://github.com/peaceiris/actions-gh-pages/issues/458)
|
||||||
|
* bump jest-circus from 26.4.1 to 26.4.2 (#460) ([5487610](https://github.com/peaceiris/actions-gh-pages/commit/548761031c6cca51ad96d778241b2f4189e85876)), closes [#460](https://github.com/peaceiris/actions-gh-pages/issues/460)
|
||||||
|
* bump jest-circus from 26.4.2 to 26.5.1 (#498) ([2cddccc](https://github.com/peaceiris/actions-gh-pages/commit/2cddccc8c3678fdfa63dd9a29bbca1ace787eade)), closes [#498](https://github.com/peaceiris/actions-gh-pages/issues/498)
|
||||||
|
* bump lint-staged from 10.2.11 to 10.2.13 (#463) ([67200cf](https://github.com/peaceiris/actions-gh-pages/commit/67200cfb5a4969bf12cbc84e48a072956aad09ca)), closes [#463](https://github.com/peaceiris/actions-gh-pages/issues/463)
|
||||||
|
* bump lint-staged from 10.2.13 to 10.3.0 (#473) ([0762b5c](https://github.com/peaceiris/actions-gh-pages/commit/0762b5c9b9d1d565ef5dd34b6cfd8e7864ffdf15)), closes [#473](https://github.com/peaceiris/actions-gh-pages/issues/473)
|
||||||
|
* bump lint-staged from 10.3.0 to 10.4.0 (#485) ([abae70b](https://github.com/peaceiris/actions-gh-pages/commit/abae70beb5c5f4d3e69fad85eec74879a7c022e4)), closes [#485](https://github.com/peaceiris/actions-gh-pages/issues/485)
|
||||||
|
* bump node from 12.18.3 to 12.18.4 (#489) ([9fba4cf](https://github.com/peaceiris/actions-gh-pages/commit/9fba4cf667368d5b10eff9771bfd1df51546b1d8)), closes [#489](https://github.com/peaceiris/actions-gh-pages/issues/489)
|
||||||
|
* bump node-fetch from 2.6.0 to 2.6.1 (#479) ([45708a0](https://github.com/peaceiris/actions-gh-pages/commit/45708a03737eaa992c9b6979c21a8b852bbc5f6a)), closes [#479](https://github.com/peaceiris/actions-gh-pages/issues/479)
|
||||||
|
* bump prettier from 2.0.5 to 2.1.0 (#462) ([37b07f7](https://github.com/peaceiris/actions-gh-pages/commit/37b07f70e3922aaf5677eb3ebdf2ffc0fd18cfab)), closes [#462](https://github.com/peaceiris/actions-gh-pages/issues/462)
|
||||||
|
* bump prettier from 2.1.0 to 2.1.1 (#465) ([8955511](https://github.com/peaceiris/actions-gh-pages/commit/8955511f502023da36495f9331276ee8257a44d8)), closes [#465](https://github.com/peaceiris/actions-gh-pages/issues/465)
|
||||||
|
* bump prettier from 2.1.1 to 2.1.2 (#483) ([fe21b42](https://github.com/peaceiris/actions-gh-pages/commit/fe21b422bf4670fb994fee05bef0563b80d29a31)), closes [#483](https://github.com/peaceiris/actions-gh-pages/issues/483)
|
||||||
|
* bump standard-version from 8.0.2 to 9.0.0 (#453) ([8146aed](https://github.com/peaceiris/actions-gh-pages/commit/8146aedaa917e5ba0e9383328b53b283506f286b)), closes [#453](https://github.com/peaceiris/actions-gh-pages/issues/453)
|
||||||
|
* bump ts-jest from 25.5.1 to 26.2.0 (#448) ([42cf996](https://github.com/peaceiris/actions-gh-pages/commit/42cf99685e494616538e9f3e9f49524a1964de37)), closes [#448](https://github.com/peaceiris/actions-gh-pages/issues/448)
|
||||||
|
* bump ts-jest from 26.2.0 to 26.3.0 (#467) ([5a84f48](https://github.com/peaceiris/actions-gh-pages/commit/5a84f48f784a37aa957d6ca09e66026a251aa46c)), closes [#467](https://github.com/peaceiris/actions-gh-pages/issues/467)
|
||||||
|
* bump ts-jest from 26.3.0 to 26.4.0 (#492) ([edfebaf](https://github.com/peaceiris/actions-gh-pages/commit/edfebaf01b68194497965068543f085f726ad1bf)), closes [#492](https://github.com/peaceiris/actions-gh-pages/issues/492)
|
||||||
|
* bump ts-jest from 26.4.0 to 26.4.1 (#495) ([b4f6cbe](https://github.com/peaceiris/actions-gh-pages/commit/b4f6cbe8b15af25d3f1b5e3e11066669a792ccae)), closes [#495](https://github.com/peaceiris/actions-gh-pages/issues/495)
|
||||||
|
* bump typescript from 3.9.7 to 4.0.2 (#468) ([d874503](https://github.com/peaceiris/actions-gh-pages/commit/d87450373360617bad3affaa5e3ef40153eeaaee)), closes [#468](https://github.com/peaceiris/actions-gh-pages/issues/468)
|
||||||
|
* bump typescript from 4.0.2 to 4.0.3 (#490) ([120ec44](https://github.com/peaceiris/actions-gh-pages/commit/120ec442c194f65cc7fbfba21cbe4987480cf914)), closes [#490](https://github.com/peaceiris/actions-gh-pages/issues/490)
|
||||||
|
* change @zeit/ncc to @vercel/ncc (#459) ([79bf213](https://github.com/peaceiris/actions-gh-pages/commit/79bf213729e88d1c383575834ddac86d57d3daa5)), closes [#459](https://github.com/peaceiris/actions-gh-pages/issues/459)
|
||||||
|
|
||||||
|
### docs
|
||||||
|
|
||||||
|
* add note about keep_files and force_orphan (#456) ([fb9ff7f](https://github.com/peaceiris/actions-gh-pages/commit/fb9ff7fb2ebdc1a780c8a17bbdb3c71d6d1ccc38)), closes [#456](https://github.com/peaceiris/actions-gh-pages/issues/456) [#455](https://github.com/peaceiris/actions-gh-pages/issues/455)
|
||||||
|
* bump v3.7.0-6 to v3.7.0-8 ([d7934f1](https://github.com/peaceiris/actions-gh-pages/commit/d7934f1bfbc15c35643fbec079d6483308ac867c))
|
||||||
|
* change master branch to another (#436) ([f89d868](https://github.com/peaceiris/actions-gh-pages/commit/f89d8688b5d8ad20b650ecaf48e1dc1d07178674)), closes [#436](https://github.com/peaceiris/actions-gh-pages/issues/436)
|
||||||
|
* Fix typo in README (#476) ([f3be898](https://github.com/peaceiris/actions-gh-pages/commit/f3be898a9685a229d5312bbc6a63eb8d2c5a0f02)), closes [#476](https://github.com/peaceiris/actions-gh-pages/issues/476)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [3.7.0-8](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0-7...v3.7.0-8) (2020-08-09)
|
||||||
|
|
||||||
|
|
||||||
|
### chore
|
||||||
|
|
||||||
|
* Add vscode devcontainer ([6b302fd](https://github.com/peaceiris/actions-gh-pages/commit/6b302fdd506eb1874da1e7245b19bc66c4db0bfc))
|
||||||
|
|
||||||
|
### ci
|
||||||
|
|
||||||
|
* Add actions runner env (#443) ([ba912f7](https://github.com/peaceiris/actions-gh-pages/commit/ba912f746bdcba752e96a9c6731af9f9ff289f0e)), closes [#443](https://github.com/peaceiris/actions-gh-pages/issues/443)
|
||||||
|
|
||||||
|
### deps
|
||||||
|
|
||||||
|
* bump @types/jest from 26.0.7 to 26.0.8 (#439) ([3f71ec2](https://github.com/peaceiris/actions-gh-pages/commit/3f71ec211a08aef8dde6999c8ee81dae974a26f2)), closes [#439](https://github.com/peaceiris/actions-gh-pages/issues/439)
|
||||||
|
* bump @types/jest from 26.0.8 to 26.0.9 (#442) ([02db90c](https://github.com/peaceiris/actions-gh-pages/commit/02db90c5c8564c8b0c1432aca1b52d66d10c7583)), closes [#442](https://github.com/peaceiris/actions-gh-pages/issues/442)
|
||||||
|
* bump @types/node from 12.12.53 to 12.12.54 (#441) ([b5599b3](https://github.com/peaceiris/actions-gh-pages/commit/b5599b36fdd4acffdb3fb4d55bb94ac76a2b3b98)), closes [#441](https://github.com/peaceiris/actions-gh-pages/issues/441)
|
||||||
|
|
||||||
|
### refactor
|
||||||
|
|
||||||
|
* Enhance log (#444) ([f800244](https://github.com/peaceiris/actions-gh-pages/commit/f80024481c7939706fac36cee86324c56371d6fd)), closes [#444](https://github.com/peaceiris/actions-gh-pages/issues/444)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [3.7.0-7](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0-6...v3.7.0-7) (2020-08-02)
|
# [3.7.0-7](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0-6...v3.7.0-7) (2020-08-02)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
15
Dockerfile
15
Dockerfile
@@ -29,13 +29,22 @@ RUN curl -o nodejs.deb "https://deb.nodesource.com/node_${NODE_VERSION%%.*}.x/po
|
|||||||
|
|
||||||
WORKDIR /repo
|
WORKDIR /repo
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND="noninteractive"
|
||||||
ENV LANG="C.UTF-8"
|
ENV LANG="C.UTF-8"
|
||||||
ENV ImageVersion="20200625.0"
|
ENV CI="true"
|
||||||
|
ENV ImageVersion="20200717.1"
|
||||||
|
ENV GITHUB_SERVER_URL="https://github.com"
|
||||||
ENV GITHUB_API_URL="https://api.github.com"
|
ENV GITHUB_API_URL="https://api.github.com"
|
||||||
ENV RUNNER_TOOL_CACHE="/opt/hostedtoolcache"
|
ENV GITHUB_GRAPHQL_URL="https://api.github.com/graphql"
|
||||||
ENV GITHUB_REPOSITORY_OWNER="peaceiris"
|
ENV GITHUB_REPOSITORY_OWNER="peaceiris"
|
||||||
ENV GITHUB_ACTIONS="true"
|
ENV GITHUB_ACTIONS="true"
|
||||||
ENV CI="true"
|
ENV GITHUB_ACTOR="peaceiris"
|
||||||
|
ENV GITHUB_REPOSITORY="actions/pages"
|
||||||
|
ENV RUNNER_OS="Linux"
|
||||||
|
ENV RUNNER_TOOL_CACHE="/opt/hostedtoolcache"
|
||||||
|
ENV RUNNER_USER="runner"
|
||||||
|
ENV RUNNER_TEMP="/home/runner/work/_temp"
|
||||||
|
ENV RUNNER_WORKSPACE="/home/runner/work/pages"
|
||||||
|
|
||||||
RUN echo "node version: $(node -v)" && \
|
RUN echo "node version: $(node -v)" && \
|
||||||
echo "npm version: $(npm -v)" && \
|
echo "npm version: $(npm -v)" && \
|
||||||
|
|||||||
123
README.md
123
README.md
@@ -1,3 +1,7 @@
|
|||||||
|
## GitHub Actions for GitHub Pages
|
||||||
|
|
||||||
|
<img width="400" alt="GitHub Actions for deploying to GitHub Pages with Static Site Generators" src="./images/ogp.svg">
|
||||||
|
|
||||||
[](https://github.com/peaceiris/actions-gh-pages/blob/main/LICENSE)
|
[](https://github.com/peaceiris/actions-gh-pages/blob/main/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)
|
||||||
@@ -5,12 +9,6 @@
|
|||||||

|

|
||||||
[](https://www.codefactor.io/repository/github/peaceiris/actions-gh-pages)
|
[](https://www.codefactor.io/repository/github/peaceiris/actions-gh-pages)
|
||||||
|
|
||||||
<img width="400" alt="GitHub Actions for deploying to GitHub Pages with Static Site Generators" src="./images/ogp.svg">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 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, mdBook, Next, Nuxt, and so on.)
|
This deploy action can be combined simply and freely with [Static Site Generators]. (Hugo, MkDocs, Gatsby, mdBook, Next, Nuxt, and so on.)
|
||||||
|
|
||||||
@@ -18,7 +16,6 @@ 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@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
@@ -38,12 +35,9 @@ Three tokens are supported.
|
|||||||
| `personal_token` | ✅️ | ✅️ | HTTPS | Necessary |
|
| `personal_token` | ✅️ | ✅️ | HTTPS | Necessary |
|
||||||
|
|
||||||
Notes: Actually, the `GITHUB_TOKEN` works for deploying to GitHub Pages but it has still some limitations.
|
Notes: Actually, the `GITHUB_TOKEN` works for deploying to GitHub Pages but it has still some limitations.
|
||||||
For the first deployment, we need to select the `gh-pages` branch or `master` branch on the repository settings tab.
|
For the first deployment, we need to select the `gh-pages` branch or another branch on the repository settings tab.
|
||||||
See [First Deployment with `GITHUB_TOKEN`](#%EF%B8%8F-first-deployment-with-github_token)
|
See [First Deployment with `GITHUB_TOKEN`](#%EF%B8%8F-first-deployment-with-github_token)
|
||||||
|
|
||||||
And you may need to push manually for the first deployment on a private repository.
|
|
||||||
See [Issue #349](https://github.com/peaceiris/actions-gh-pages/issues/349)
|
|
||||||
|
|
||||||
### Supported Platforms
|
### Supported Platforms
|
||||||
|
|
||||||
All Actions runners: Linux (Ubuntu), macOS, and Windows are supported.
|
All Actions runners: Linux (Ubuntu), macOS, and Windows are supported.
|
||||||
@@ -67,13 +61,11 @@ All Actions runners: Linux (Ubuntu), macOS, and Windows are supported.
|
|||||||
|
|
||||||
|
|
||||||
- [Getting started](#getting-started)
|
- [Getting started](#getting-started)
|
||||||
- [⭐️ Repository type - Project](#%EF%B8%8F-repository-type---project)
|
|
||||||
- [⭐️ Repository type - User and Organization](#%EF%B8%8F-repository-type---user-and-organization)
|
|
||||||
- [Options](#options)
|
- [Options](#options)
|
||||||
- [⭐️ Set Runner's Access Token `github_token`](#%EF%B8%8F-set-runners-access-token-github_token)
|
- [⭐️ Set Runner's Access Token `github_token`](#%EF%B8%8F-set-runners-access-token-github_token)
|
||||||
- [⭐️ Set SSH Private Key `deploy_key`](#%EF%B8%8F-set-ssh-private-key-deploy_key)
|
- [⭐️ Set SSH Private Key `deploy_key`](#%EF%B8%8F-set-ssh-private-key-deploy_key)
|
||||||
- [⭐️ Set Personal Access Token `personal_token`](#%EF%B8%8F-set-personal-access-token-personal_token)
|
- [⭐️ Set Personal Access Token `personal_token`](#%EF%B8%8F-set-personal-access-token-personal_token)
|
||||||
- [⭐️ Target Branch `publish_branch`](#%EF%B8%8F-target-branch-publish_branch)
|
- [⭐️ Set Another GitHub Pages Branch `publish_branch`](#%EF%B8%8F-set-another-github-pages-branch-publish_branch)
|
||||||
- [⭐️ Source Directory `publish_dir`](#%EF%B8%8F-source-directory-publish_dir)
|
- [⭐️ Source Directory `publish_dir`](#%EF%B8%8F-source-directory-publish_dir)
|
||||||
- [⭐️ Deploy to Subdirectory `destination_dir`](#%EF%B8%8F-deploy-to-subdirectory-destination_dir)
|
- [⭐️ Deploy to Subdirectory `destination_dir`](#%EF%B8%8F-deploy-to-subdirectory-destination_dir)
|
||||||
- [⭐️ Filter publishing assets `exclude_assets`](#%EF%B8%8F-filter-publishing-assets-exclude_assets)
|
- [⭐️ Filter publishing assets `exclude_assets`](#%EF%B8%8F-filter-publishing-assets-exclude_assets)
|
||||||
@@ -112,11 +104,9 @@ All Actions runners: Linux (Ubuntu), macOS, and Windows are supported.
|
|||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
### ⭐️ Repository type - Project
|
Add your workflow file `.github/workflows/gh-pages.yml` and push it to your remote default branch.
|
||||||
|
|
||||||
Add your workflow file `.github/workflows/gh-pages.yml` and push to the remote default branch branch.
|
Here is an example workflow for Hugo.
|
||||||
|
|
||||||
An example workflow for Hugo.
|
|
||||||
|
|
||||||
- [peaceiris/actions-hugo: GitHub Actions for Hugo](https://github.com/peaceiris/actions-hugo)
|
- [peaceiris/actions-hugo: GitHub Actions for Hugo](https://github.com/peaceiris/actions-hugo)
|
||||||
|
|
||||||
@@ -128,7 +118,7 @@ name: github pages
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main # Set a branch name to trigger deployment
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
@@ -154,47 +144,10 @@ jobs:
|
|||||||
publish_dir: ./public
|
publish_dir: ./public
|
||||||
```
|
```
|
||||||
|
|
||||||
The above example is for [Project Pages sites]. (`<username>/<project_name>` repository)
|
|
||||||
|
|
||||||
| Actions log overview | GitHub Pages log |
|
| Actions log overview | GitHub Pages log |
|
||||||
|---|---|
|
|---|---|
|
||||||
|  |  |
|
|  |  |
|
||||||
|
|
||||||
### ⭐️ Repository type - User and Organization
|
|
||||||
|
|
||||||
For [User and Organization Pages sites] (`<username>/<username>.github.io` repository),
|
|
||||||
we have to set `master` branch to `publish_branch`.
|
|
||||||
|
|
||||||
A default value of `publish_branch` is `gh-pages`.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- source # default branch
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- run: somebuild
|
|
||||||
|
|
||||||
- name: Deploy
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
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
|
|
||||||
[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>
|
||||||
</div>
|
</div>
|
||||||
@@ -243,16 +196,17 @@ Read [Create SSH Deploy Key](#%EF%B8%8F-create-ssh-deploy-key), create your SSH
|
|||||||
publish_dir: ./public
|
publish_dir: ./public
|
||||||
```
|
```
|
||||||
|
|
||||||
### ⭐️ Target Branch `publish_branch`
|
### ⭐️ Set Another GitHub Pages Branch `publish_branch`
|
||||||
|
|
||||||
A target branch to deploy to GitHub Pages. The default is `gh-pages`.
|
Set a branch name to use as GitHub Pages branch.
|
||||||
|
The default is `gh-pages`.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_branch: master # default: gh-pages
|
publish_branch: your-branch # default: gh-pages
|
||||||
```
|
```
|
||||||
|
|
||||||
### ⭐️ Source Directory `publish_dir`
|
### ⭐️ Source Directory `publish_dir`
|
||||||
@@ -276,7 +230,7 @@ A destination subdirectory on a publishing branch. The default is empty.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v3.7.0-6
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
destination_dir: subdir
|
destination_dir: subdir
|
||||||
@@ -293,7 +247,7 @@ Values should be split with a comma.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v3.7.0-6
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
exclude_assets: '.github,exclude-file1,exclude-file2'
|
exclude_assets: '.github,exclude-file1,exclude-file2'
|
||||||
@@ -303,9 +257,11 @@ Set `exclude_assets` to empty for including the `.github` directory to deploymen
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v3.7.0-6
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} # Recommended for this usage
|
||||||
|
# personal_token: ${{ secrets.PERSONAL_TOKEN }} # An alternative
|
||||||
|
# github_token: ${{ secrets.GITHUB_TOKEN }} # This does not work for this usage
|
||||||
exclude_assets: ''
|
exclude_assets: ''
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -313,7 +269,7 @@ The `exclude_assets` option supports glob patterns.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v3.7.0-6
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
exclude_assets: '.github,exclude-file.txt,exclude-dir/**.txt'
|
exclude_assets: '.github,exclude-file.txt,exclude-dir/**.txt'
|
||||||
@@ -375,6 +331,11 @@ For example:
|
|||||||
|
|
||||||
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`.
|
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`.
|
||||||
|
|
||||||
|
Note that users who are using a Static Site Generator do not need this option in most cases. Please reconsider your project structure and building scripts, or use a built-in feature of a Static Site Generator before you enable this flag.
|
||||||
|
|
||||||
|
- [Static Files | Hugo](https://gohugo.io/content-management/static-files/)
|
||||||
|
- [Using the Static Folder | Gatsby](https://www.gatsbyjs.com/docs/static-folder/)
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -386,6 +347,9 @@ For example:
|
|||||||
keep_files: true
|
keep_files: true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
With the v3, this option does not support working with the force_orphan option. The next major release (version 4) will support this.
|
||||||
|
See [the issue #455](https://github.com/peaceiris/actions-gh-pages/issues/455)
|
||||||
|
|
||||||
### ⭐️ Deploy to external repository `external_repository`
|
### ⭐️ Deploy to external repository `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.
|
||||||
@@ -399,7 +363,7 @@ For example:
|
|||||||
with:
|
with:
|
||||||
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
external_repository: username/external-repository
|
external_repository: username/external-repository
|
||||||
publish_branch: master
|
publish_branch: your-branch # default: gh-pages
|
||||||
publish_dir: ./public
|
publish_dir: ./public
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -632,12 +596,15 @@ jobs:
|
|||||||
|
|
||||||
### ⭐️ Static Site Generators with Node.js
|
### ⭐️ Static Site Generators with Node.js
|
||||||
|
|
||||||
[hexo], [vuepress], [react-static], [gridsome], and so on.
|
[hexo], [vuepress], [react-static], [gridsome], [create-react-app] and so on.
|
||||||
|
Please check where your output directory is before pushing your workflow.
|
||||||
|
e.g. `create-react-app` requires `publish_dir` to be set to `./build`
|
||||||
|
|
||||||
[hexo]: https://github.com/hexojs/hexo
|
[hexo]: https://github.com/hexojs/hexo
|
||||||
[vuepress]: https://github.com/vuejs/vuepress
|
[vuepress]: https://github.com/vuejs/vuepress
|
||||||
[react-static]: https://github.com/react-static/react-static
|
[react-static]: https://github.com/react-static/react-static
|
||||||
[gridsome]: https://github.com/gridsome/gridsome
|
[gridsome]: https://github.com/gridsome/gridsome
|
||||||
|
[create-react-app]: https://github.com/facebook/create-react-app
|
||||||
|
|
||||||
Premise: Dependencies are managed by `package.json` and `package-lock.json`
|
Premise: Dependencies are managed by `package.json` and `package-lock.json`
|
||||||
|
|
||||||
@@ -995,7 +962,7 @@ jobs:
|
|||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/flutter/flutter.git --depth 1 -b beta _flutter
|
git clone https://github.com/flutter/flutter.git --depth 1 -b beta _flutter
|
||||||
echo "::add-path::${GITHUB_WORKSPACE}/_flutter/bin"
|
echo "${GITHUB_WORKSPACE}/_flutter/bin" >> ${GITHUB_PATH}
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
run: |
|
run: |
|
||||||
@@ -1014,7 +981,7 @@ jobs:
|
|||||||
|
|
||||||
### ⭐️ Elm
|
### ⭐️ Elm
|
||||||
|
|
||||||
An exapmle workflow for [Elm].
|
An example workflow for [Elm].
|
||||||
|
|
||||||
[Elm]: https://elm-lang.org
|
[Elm]: https://elm-lang.org
|
||||||
|
|
||||||
@@ -1104,17 +1071,29 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/Publish_build
|
||||||
|
.build
|
||||||
|
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-spm-
|
||||||
|
|
||||||
- name: Setup JohnSundell/Publish
|
- name: Setup JohnSundell/Publish
|
||||||
run: |
|
run: |
|
||||||
cd ${HOME}
|
cd ${HOME}
|
||||||
git clone --depth=1 https://github.com/JohnSundell/Publish.git
|
export PUBLISH_VERSION="0.7.0"
|
||||||
cd ./Publish
|
git clone https://github.com/JohnSundell/Publish.git
|
||||||
|
cd ./Publish && git checkout ${PUBLISH_VERSION}
|
||||||
|
mv ~/Publish_build .build || true
|
||||||
swift build -c release
|
swift build -c release
|
||||||
echo "::add-path::${HOME}/Publish/.build/release"
|
cp -r .build ~/Publish_build || true
|
||||||
|
echo "${HOME}/Publish/.build/release" >> ${GITHUB_PATH}
|
||||||
|
|
||||||
- run: publish-cli generate
|
- run: publish-cli generate
|
||||||
|
|
||||||
|
|||||||
1
__tests__/fixtures/publish_dir_1/assets/lib.css
Normal file
1
__tests__/fixtures/publish_dir_1/assets/lib.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* CSS */
|
||||||
1
__tests__/fixtures/publish_dir_1/assets/lib.js
Normal file
1
__tests__/fixtures/publish_dir_1/assets/lib.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// JavaScript
|
||||||
11
__tests__/fixtures/publish_dir_1/index.html
Normal file
11
__tests__/fixtures/publish_dir_1/index.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
1
__tests__/fixtures/publish_dir_1/main.css
Normal file
1
__tests__/fixtures/publish_dir_1/main.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* CSS */
|
||||||
1
__tests__/fixtures/publish_dir_1/main.js
Normal file
1
__tests__/fixtures/publish_dir_1/main.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// JavaScript
|
||||||
1
__tests__/fixtures/publish_dir_root/.github/CODEOWNERS
vendored
Normal file
1
__tests__/fixtures/publish_dir_root/.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
|
||||||
1
__tests__/fixtures/publish_dir_root/.github/ISSUE_TEMPLATE/template.md
vendored
Normal file
1
__tests__/fixtures/publish_dir_root/.github/ISSUE_TEMPLATE/template.md
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<!-- issue template -->
|
||||||
7
__tests__/fixtures/publish_dir_root/.github/dependabot.yml
vendored
Normal file
7
__tests__/fixtures/publish_dir_root/.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# dependabot config
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: npm
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
1
__tests__/fixtures/publish_dir_root/.github/workflows/test.yml
vendored
Normal file
1
__tests__/fixtures/publish_dir_root/.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
name: 'Test'
|
||||||
1
__tests__/fixtures/publish_dir_root/assets/lib.css
Normal file
1
__tests__/fixtures/publish_dir_root/assets/lib.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* CSS */
|
||||||
1
__tests__/fixtures/publish_dir_root/assets/lib.js
Normal file
1
__tests__/fixtures/publish_dir_root/assets/lib.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// JavaScript
|
||||||
11
__tests__/fixtures/publish_dir_root/index.html
Normal file
11
__tests__/fixtures/publish_dir_root/index.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
1
__tests__/fixtures/publish_dir_root/main.css
Normal file
1
__tests__/fixtures/publish_dir_root/main.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* CSS */
|
||||||
1
__tests__/fixtures/publish_dir_root/main.js
Normal file
1
__tests__/fixtures/publish_dir_root/main.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// JavaScript
|
||||||
@@ -9,7 +9,8 @@ beforeEach(() => {
|
|||||||
jest.resetModules();
|
jest.resetModules();
|
||||||
process.stdout.write = jest.fn();
|
process.stdout.write = jest.fn();
|
||||||
|
|
||||||
const doc = yaml.safeLoad(fs.readFileSync(__dirname + '/../action.yml', 'utf8'));
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
const doc: any = yaml.safeLoad(fs.readFileSync(__dirname + '/../action.yml', 'utf8'));
|
||||||
Object.keys(doc.inputs).forEach(name => {
|
Object.keys(doc.inputs).forEach(name => {
|
||||||
const envVar = `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
const envVar = `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
||||||
process.env[envVar] = doc.inputs[name]['default'];
|
process.env[envVar] = doc.inputs[name]['default'];
|
||||||
@@ -17,7 +18,8 @@ beforeEach(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
const doc = yaml.safeLoad(fs.readFileSync(__dirname + '/../action.yml', 'utf8'));
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
const doc: any = yaml.safeLoad(fs.readFileSync(__dirname + '/../action.yml', 'utf8'));
|
||||||
Object.keys(doc.inputs).forEach(name => {
|
Object.keys(doc.inputs).forEach(name => {
|
||||||
const envVar = `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
const envVar = `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
||||||
console.debug(`delete ${envVar}\t${process.env[envVar]}`);
|
console.debug(`delete ${envVar}\t${process.env[envVar]}`);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
copyAssets,
|
||||||
setRepo,
|
setRepo,
|
||||||
getUserName,
|
getUserName,
|
||||||
getUserEmail,
|
getUserEmail,
|
||||||
@@ -10,6 +11,17 @@ import {Inputs} from '../src/interfaces';
|
|||||||
import {getWorkDirName, createDir} from '../src/utils';
|
import {getWorkDirName, createDir} from '../src/utils';
|
||||||
import {CmdResult} from '../src/interfaces';
|
import {CmdResult} from '../src/interfaces';
|
||||||
import * as exec from '@actions/exec';
|
import * as exec from '@actions/exec';
|
||||||
|
import {cp, rm} from 'shelljs';
|
||||||
|
import path from 'path';
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
const testRoot = path.resolve(__dirname);
|
||||||
|
|
||||||
|
async function createTestDir(name: string): Promise<string> {
|
||||||
|
const date = new Date();
|
||||||
|
const unixTime = date.getTime();
|
||||||
|
return await getWorkDirName(`${unixTime}_${name}`);
|
||||||
|
}
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.resetModules();
|
jest.resetModules();
|
||||||
@@ -22,6 +34,96 @@ afterEach(() => {
|
|||||||
delete process.env['GITHUB_REPOSITORY'];
|
delete process.env['GITHUB_REPOSITORY'];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('copyAssets', () => {
|
||||||
|
let gitTempDir = '';
|
||||||
|
(async (): Promise<void> => {
|
||||||
|
const date = new Date();
|
||||||
|
const unixTime = date.getTime();
|
||||||
|
gitTempDir = await getWorkDirName(`${unixTime}_git`);
|
||||||
|
})();
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
await createDir(gitTempDir);
|
||||||
|
process.chdir(gitTempDir);
|
||||||
|
await exec.exec('git', ['init']);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('copy assets from publish_dir to root, delete .github', async () => {
|
||||||
|
const publishDir = await createTestDir('src');
|
||||||
|
const destDir = await createTestDir('dst');
|
||||||
|
cp('-Rf', path.resolve(testRoot, 'fixtures/publish_dir_1'), publishDir);
|
||||||
|
cp('-Rf', gitTempDir, destDir);
|
||||||
|
|
||||||
|
await copyAssets(publishDir, destDir, '.github');
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, '.github'))).toBeFalsy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'index.html'))).toBeTruthy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.css'))).toBeTruthy();
|
||||||
|
rm('-rf', publishDir, destDir);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('copy assets from publish_dir to root, delete .github,main.js', async () => {
|
||||||
|
const publishDir = await createTestDir('src');
|
||||||
|
const destDir = await createTestDir('dst');
|
||||||
|
cp('-Rf', path.resolve(testRoot, 'fixtures/publish_dir_1'), publishDir);
|
||||||
|
cp('-Rf', gitTempDir, destDir);
|
||||||
|
|
||||||
|
await copyAssets(publishDir, destDir, '.github,main.js');
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, '.github'))).toBeFalsy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'index.html'))).toBeTruthy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'main.js'))).toBeFalsy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.css'))).toBeTruthy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.js'))).toBeTruthy();
|
||||||
|
rm('-rf', publishDir, destDir);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('copy assets from publish_dir to root, delete nothing', async () => {
|
||||||
|
const publishDir = await createTestDir('src');
|
||||||
|
const destDir = await createTestDir('dst');
|
||||||
|
cp('-Rf', path.resolve(testRoot, 'fixtures/publish_dir_root'), publishDir);
|
||||||
|
cp('-Rf', gitTempDir, destDir);
|
||||||
|
|
||||||
|
await copyAssets(publishDir, destDir, '');
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, '.github'))).toBeTruthy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'index.html'))).toBeTruthy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'main.js'))).toBeTruthy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.css'))).toBeTruthy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.js'))).toBeTruthy();
|
||||||
|
rm('-rf', publishDir, destDir);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('copy assets from root to root, delete .github', async () => {
|
||||||
|
const publishDir = await createTestDir('src');
|
||||||
|
const destDir = await createTestDir('dst');
|
||||||
|
cp('-Rf', path.resolve(testRoot, 'fixtures/publish_dir_root'), publishDir);
|
||||||
|
cp('-Rf', gitTempDir, destDir);
|
||||||
|
cp('-Rf', gitTempDir, publishDir);
|
||||||
|
|
||||||
|
await copyAssets(publishDir, destDir, '.github');
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, '.github'))).toBeFalsy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'index.html'))).toBeTruthy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.css'))).toBeTruthy();
|
||||||
|
rm('-rf', publishDir, destDir);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('copy assets from root to root, delete nothing', async () => {
|
||||||
|
const publishDir = await createTestDir('src');
|
||||||
|
const destDir = await createTestDir('dst');
|
||||||
|
cp('-Rf', path.resolve(testRoot, 'fixtures/publish_dir_root'), publishDir);
|
||||||
|
cp('-Rf', gitTempDir, destDir);
|
||||||
|
cp('-Rf', gitTempDir, publishDir);
|
||||||
|
|
||||||
|
await copyAssets(publishDir, destDir, '');
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, '.github'))).toBeTruthy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'index.html'))).toBeTruthy();
|
||||||
|
expect(fs.existsSync(path.resolve(destDir, 'assets/lib.css'))).toBeTruthy();
|
||||||
|
rm('-rf', publishDir, destDir);
|
||||||
|
});
|
||||||
|
|
||||||
|
test.todo('copy assets from root to subdir, delete .github');
|
||||||
|
test.todo('copy assets from root to subdir, delete .github,main.js');
|
||||||
|
test.todo('copy assets from root to subdir, delete nothing');
|
||||||
|
});
|
||||||
|
|
||||||
describe('setRepo()', () => {
|
describe('setRepo()', () => {
|
||||||
test('throw error destination_dir should be a relative path', async () => {
|
test('throw error destination_dir should be a relative path', async () => {
|
||||||
process.env['INPUT_GITHUB_TOKEN'] = 'test_github_token';
|
process.env['INPUT_GITHUB_TOKEN'] = 'test_github_token';
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 54 KiB |
File diff suppressed because one or more lines are too long
4554
package-lock.json
generated
4554
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
40
package.json
40
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "actions-github-pages",
|
"name": "actions-github-pages",
|
||||||
"version": "3.7.0-7",
|
"version": "3.7.3",
|
||||||
"description": "GitHub Actions for GitHub Pages",
|
"description": "GitHub Actions for GitHub Pages",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -54,31 +54,33 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/peaceiris/actions-gh-pages#readme",
|
"homepage": "https://github.com/peaceiris/actions-gh-pages#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.4",
|
"@actions/core": "^1.2.6",
|
||||||
"@actions/exec": "^1.0.4",
|
"@actions/exec": "^1.0.4",
|
||||||
"@actions/github": "^4.0.0",
|
"@actions/github": "^4.0.0",
|
||||||
"@actions/glob": "^0.1.0",
|
"@actions/glob": "^0.1.0",
|
||||||
"@actions/io": "^1.0.2"
|
"@actions/io": "^1.0.2",
|
||||||
|
"@types/shelljs": "^0.8.8",
|
||||||
|
"shelljs": "^0.8.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^26.0.7",
|
"@types/jest": "^26.0.14",
|
||||||
"@types/js-yaml": "^3.12.4",
|
"@types/js-yaml": "^3.12.5",
|
||||||
"@types/node": "~12",
|
"@types/node": "~12",
|
||||||
"@typescript-eslint/eslint-plugin": "^2.34.0",
|
"@typescript-eslint/eslint-plugin": "^4.4.0",
|
||||||
"@typescript-eslint/parser": "^2.34.0",
|
"@typescript-eslint/parser": "^4.4.0",
|
||||||
"@zeit/ncc": "^0.22.3",
|
"@vercel/ncc": "^0.24.1",
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^7.11.0",
|
||||||
"eslint-config-prettier": "^6.11.0",
|
"eslint-config-prettier": "^6.12.0",
|
||||||
"eslint-plugin-jest": "^23.20.0",
|
"eslint-plugin-jest": "^24.1.0",
|
||||||
"eslint-plugin-prettier": "^3.1.4",
|
"eslint-plugin-prettier": "^3.1.4",
|
||||||
"husky": "^4.2.5",
|
"husky": "^4.3.0",
|
||||||
"jest": "^25.5.4",
|
"jest": "^26.5.3",
|
||||||
"jest-circus": "^26.2.2",
|
"jest-circus": "^26.5.3",
|
||||||
"js-yaml": "^3.14.0",
|
"js-yaml": "^3.14.0",
|
||||||
"lint-staged": "^10.2.11",
|
"lint-staged": "^10.4.0",
|
||||||
"prettier": "2.0.5",
|
"prettier": "2.1.2",
|
||||||
"standard-version": "^8.0.2",
|
"standard-version": "^9.0.0",
|
||||||
"ts-jest": "^25.5.1",
|
"ts-jest": "^26.4.1",
|
||||||
"typescript": "^3.9.7"
|
"typescript": "^4.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as exec from '@actions/exec';
|
import * as exec from '@actions/exec';
|
||||||
import * as io from '@actions/io';
|
|
||||||
import * as glob from '@actions/glob';
|
import * as glob from '@actions/glob';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import {Inputs, CmdResult} from './interfaces';
|
import {Inputs, CmdResult} from './interfaces';
|
||||||
import {createDir} from './utils';
|
import {createDir} from './utils';
|
||||||
|
import {cp, rm} from 'shelljs';
|
||||||
|
|
||||||
export async function createBranchForce(branch: string): Promise<void> {
|
export async function createBranchForce(branch: string): Promise<void> {
|
||||||
await exec.exec('git', ['init']);
|
await exec.exec('git', ['init']);
|
||||||
@@ -14,6 +14,7 @@ export async function createBranchForce(branch: string): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteExcludedAssets(destDir: string, excludeAssets: string): Promise<void> {
|
export async function deleteExcludedAssets(destDir: string, excludeAssets: string): Promise<void> {
|
||||||
|
if (excludeAssets === '') return;
|
||||||
core.info(`[INFO] delete excluded assets`);
|
core.info(`[INFO] delete excluded assets`);
|
||||||
const excludedAssetNames: Array<string> = excludeAssets.split(',');
|
const excludedAssetNames: Array<string> = excludeAssets.split(',');
|
||||||
const excludedAssetPaths = ((): Array<string> => {
|
const excludedAssetPaths = ((): Array<string> => {
|
||||||
@@ -24,10 +25,11 @@ export async function deleteExcludedAssets(destDir: string, excludeAssets: strin
|
|||||||
return paths;
|
return paths;
|
||||||
})();
|
})();
|
||||||
const globber = await glob.create(excludedAssetPaths.join('\n'));
|
const globber = await glob.create(excludedAssetPaths.join('\n'));
|
||||||
for await (const asset of globber.globGenerator()) {
|
const files = await globber.glob();
|
||||||
io.rmRF(asset);
|
for await (const file of globber.globGenerator()) {
|
||||||
core.info(`[INFO] delete ${asset}`);
|
core.info(`[INFO] delete ${file}`);
|
||||||
}
|
}
|
||||||
|
rm('-rf', files);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,24 +39,21 @@ export async function copyAssets(
|
|||||||
excludeAssets: string
|
excludeAssets: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
core.info(`[INFO] prepare publishing assets`);
|
core.info(`[INFO] prepare publishing assets`);
|
||||||
const copyOpts = {recursive: true, force: true};
|
|
||||||
const files = fs.readdirSync(publishDir);
|
if (!fs.existsSync(destDir)) {
|
||||||
core.debug(`${files}`);
|
core.info(`[INFO] create ${destDir}`);
|
||||||
for await (const file of files) {
|
await createDir(destDir);
|
||||||
if (file === '.git') {
|
|
||||||
core.info(`[INFO] skip ${file}`);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const filePublishPath = path.join(publishDir, file);
|
|
||||||
const fileDestPath = path.join(destDir, file);
|
|
||||||
const destPath = path.dirname(fileDestPath);
|
|
||||||
if (fs.existsSync(destPath) === false) {
|
|
||||||
await createDir(destPath);
|
|
||||||
}
|
|
||||||
await io.cp(filePublishPath, fileDestPath, copyOpts);
|
|
||||||
core.info(`[INFO] copy ${file}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dotGitPath = path.join(publishDir, '.git');
|
||||||
|
if (fs.existsSync(dotGitPath)) {
|
||||||
|
core.info(`[INFO] delete ${dotGitPath}`);
|
||||||
|
rm('-rf', dotGitPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
core.info(`[INFO] copy ${publishDir} to ${destDir}`);
|
||||||
|
cp('-RfL', [`${publishDir}/*`, `${publishDir}/.*`], destDir);
|
||||||
|
|
||||||
await deleteExcludedAssets(destDir, excludeAssets);
|
await deleteExcludedAssets(destDir, excludeAssets);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -79,6 +78,7 @@ export async function setRepo(inps: Inputs, remoteURL: string, workDir: string):
|
|||||||
core.info(`[INFO] ForceOrphan: ${inps.ForceOrphan}`);
|
core.info(`[INFO] ForceOrphan: ${inps.ForceOrphan}`);
|
||||||
if (inps.ForceOrphan) {
|
if (inps.ForceOrphan) {
|
||||||
await createDir(destDir);
|
await createDir(destDir);
|
||||||
|
core.info(`[INFO] chdir ${workDir}`);
|
||||||
process.chdir(workDir);
|
process.chdir(workDir);
|
||||||
await createBranchForce(inps.PublishBranch);
|
await createBranchForce(inps.PublishBranch);
|
||||||
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
||||||
@@ -105,34 +105,28 @@ export async function setRepo(inps: Inputs, remoteURL: string, workDir: string):
|
|||||||
);
|
);
|
||||||
if (result.exitcode === 0) {
|
if (result.exitcode === 0) {
|
||||||
await createDir(destDir);
|
await createDir(destDir);
|
||||||
process.chdir(destDir);
|
|
||||||
|
|
||||||
if (inps.DestinationDir !== '') {
|
if (inps.KeepFiles) {
|
||||||
if (inps.KeepFiles) {
|
core.info('[INFO] Keep existing files');
|
||||||
core.info('[INFO] Keep existing files');
|
|
||||||
} else {
|
|
||||||
core.info(`[INFO] clean up ${destDir}`);
|
|
||||||
await exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (inps.KeepFiles) {
|
core.info(`[INFO] clean up ${destDir}`);
|
||||||
core.info('[INFO] Keep existing files');
|
core.info(`[INFO] chdir ${destDir}`);
|
||||||
} else {
|
process.chdir(destDir);
|
||||||
core.info(`[INFO] clean up ${destDir}`);
|
await exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
|
||||||
await exec.exec('git', ['rm', '-r', '--ignore-unmatch', '*']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
core.info(`[INFO] chdir ${workDir}`);
|
||||||
process.chdir(workDir);
|
process.chdir(workDir);
|
||||||
|
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
|
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
core.info(`[INFO] first deployment, create new branch ${inps.PublishBranch}`);
|
core.info(`[INFO] first deployment, create new branch ${inps.PublishBranch}`);
|
||||||
core.info(e.message);
|
core.info(`[INFO] ${e.message}`);
|
||||||
await createDir(destDir);
|
await createDir(destDir);
|
||||||
|
core.info(`[INFO] chdir ${workDir}`);
|
||||||
process.chdir(workDir);
|
process.chdir(workDir);
|
||||||
await createBranchForce(inps.PublishBranch);
|
await createBranchForce(inps.PublishBranch);
|
||||||
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import {getWorkDirName, addNoJekyll, addCNAME, skipOnFork} from './utils';
|
|||||||
|
|
||||||
export async function run(): Promise<void> {
|
export async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
|
core.info('[INFO] Usage https://github.com/peaceiris/actions-gh-pages#readme');
|
||||||
|
|
||||||
const inps: Inputs = getInputs();
|
const inps: Inputs = getInputs();
|
||||||
core.startGroup('Dump inputs');
|
core.startGroup('Dump inputs');
|
||||||
showInputs(inps);
|
showInputs(inps);
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ 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';
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
const cpSpawnSync = require('child_process').spawnSync;
|
const cpSpawnSync = require('child_process').spawnSync;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
const cpexec = require('child_process').execFileSync;
|
const cpexec = require('child_process').execFileSync;
|
||||||
import {Inputs} from './interfaces';
|
import {Inputs} from './interfaces';
|
||||||
import {getHomeDir} from './utils';
|
import {getHomeDir} from './utils';
|
||||||
|
|||||||
Reference in New Issue
Block a user