Compare commits

...

106 Commits

Author SHA1 Message Date
peaceiris
1828d864ae chore(release): 3.5.7
Some checks failed
Release / release (push) Has been cancelled
2020-04-15 10:55:53 +09:00
peaceiris
dbc1ba3666 chore(release): Add build assets 2020-04-15 10:55:51 +09:00
Shohei Ueda
df5698c4aa deps: bump git from 2.26.0 to 2.26.1 (#233) 2020-04-15 10:50:03 +09:00
Shohei Ueda
9614091a5e docs: update 2020-04-15 09:25:23 +09:00
Shohei Ueda
98e0f6025c ci: delete stale workflow 2020-04-14 10:51:25 +09:00
Shohei Ueda
8dd38bec4d chore: bump node and npm (#232) 2020-04-14 10:31:15 +09:00
dependabot-preview[bot]
ddf2c5b9f1 deps: bump @typescript-eslint/eslint-plugin from 2.27.0 to 2.28.0 (#231) 2020-04-13 17:31:43 +00:00
dependabot-preview[bot]
d8356e3cf1 deps: bump @typescript-eslint/parser from 2.27.0 to 2.28.0 (#230) 2020-04-13 17:26:19 +00:00
Pierre Mavro
fb15409be9 docs: Update Docusaurus workflow example (#229)
* Updating Docusaurus config to make it work
* docs: Fix publish_dir

There were some issues, it was impossible to get it working just with a simple copy/paste

* Test repo: https://github.com/peaceiris/test-docusaurus
* Reference: https://docusaurus.io/docs/en/installation

Co-authored-by: peaceiris <30958501+peaceiris@users.noreply.github.com>
2020-04-13 23:27:34 +09:00
Shohei Ueda
9f90987bad docs: Add Swift Publish example (#228)
https://github.com/JohnSundell/Publish

Close #227
2020-04-11 23:58:23 +09:00
Shohei Ueda
596c2d5548 docs: Add branches 2020-04-11 23:53:15 +09:00
peaceiris
b6bc5040aa docs: bump hugo and mdbook 2020-04-11 02:59:20 +09:00
Shohei Ueda
6fcf128c18 deps: bump node 12.16.1 to 12.16.2 (#223) 2020-04-10 09:33:36 +09:00
dependabot-preview[bot]
bf8dc2ce19 deps: bump husky from 4.2.4 to 4.2.5 (#226) 2020-04-09 21:45:48 +00:00
dependabot-preview[bot]
abd7ea550b deps: bump husky from 4.2.3 to 4.2.4 (#225) 2020-04-09 16:54:41 +00:00
dependabot-preview[bot]
ab7b255432 deps: bump lint-staged from 10.1.2 to 10.1.3 (#224) 2020-04-09 15:25:09 +00:00
dependabot-preview[bot]
8af9b8c0d5 deps: bump @types/node from 12.12.34 to 12.12.35 (#222) 2020-04-08 19:15:53 +00:00
dependabot-preview[bot]
a07d7115c5 deps: bump jest from 25.2.7 to 25.3.0 (#221) 2020-04-08 15:26:31 +00:00
dependabot-preview[bot]
20e19cf1eb deps: bump jest-circus from 25.2.7 to 25.3.0 (#220) 2020-04-08 15:18:29 +00:00
dependabot-preview[bot]
da14e08646 deps: bump @typescript-eslint/parser from 2.26.0 to 2.27.0 (#218) 2020-04-07 02:30:05 +00:00
dependabot-preview[bot]
046c703d6d deps: bump @typescript-eslint/eslint-plugin from 2.26.0 to 2.27.0 (#219) 2020-04-07 02:25:48 +00:00
dependabot-preview[bot]
ab371259dd deps: bump prettier from 2.0.2 to 2.0.4 (#217) 2020-04-07 02:25:11 +00:00
dependabot-preview[bot]
711b0ed1cd deps: bump @zeit/ncc from 0.22.0 to 0.22.1 (#215)
Bumps [@zeit/ncc](https://github.com/zeit/ncc) from 0.22.0 to 0.22.1.
- [Release notes](https://github.com/zeit/ncc/releases)
- [Commits](https://github.com/zeit/ncc/compare/0.22.0...0.22.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-07 11:19:17 +09:00
dependabot-preview[bot]
e5063fa6dd deps: bump lint-staged from 10.1.1 to 10.1.2 (#214)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.1.1 to 10.1.2.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v10.1.1...v10.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-07 11:18:55 +09:00
peaceiris
58be994809 deps: npm audit fix 2020-04-04 18:52:25 +09:00
peaceiris
6d889ad7e9 ci: Add automerged_updates 2020-04-04 18:51:12 +09:00
dependabot-preview[bot]
37ce049d08 deps: bump @types/jest from 25.1.5 to 25.2.1 (#213)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 25.1.5 to 25.2.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-04 18:48:29 +09:00
Shohei Ueda
32a0227f7c docs: Add fetch-depth 0
Fetch all history for Hugo feature .GitInfo and .Lastmod
2020-04-04 14:58:15 +09:00
dependabot-preview[bot]
c742786fc9 deps: bump jest-circus from 25.2.6 to 25.2.7 (#209) 2020-04-03 15:45:01 +00:00
dependabot-preview[bot]
7f9aba2ea8 deps: bump jest from 25.2.6 to 25.2.7 (#210) 2020-04-03 15:33:22 +00:00
dependabot-preview[bot]
d48d5de82e deps: bump ts-jest from 25.3.0 to 25.3.1 (#211) 2020-04-03 15:28:17 +00:00
dependabot-preview[bot]
78d67e4cbe deps: bump @types/jest from 25.1.4 to 25.1.5 (#208) 2020-04-03 03:46:27 +00:00
dependabot-preview[bot]
7c0ae727e6 deps: bump jest-circus from 25.2.4 to 25.2.6 (#206) 2020-04-02 11:01:46 +00:00
dependabot-preview[bot]
af6a5970d8 deps: bump jest from 25.2.4 to 25.2.6 (#207) 2020-04-02 10:53:20 +00:00
Shohei Ueda
3789ef4a0a ci: Add cname 2020-04-02 19:34:58 +09:00
dependabot-preview[bot]
42a3ae6a38 deps: bump lint-staged from 10.1.0 to 10.1.1 (#205) 2020-03-31 14:48:26 +00:00
Shohei Ueda
a93c85ca96 docs: update test badge 2020-03-31 21:32:03 +09:00
Shohei Ueda
ed5a99d637 ci: Merge test workflows (#204) 2020-03-31 21:26:20 +09:00
dependabot-preview[bot]
45a2a58fb0 deps: bump @types/node from 12.12.32 to 12.12.34 (#203) 2020-03-31 07:17:40 +00:00
dependabot-preview[bot]
042b824d8b deps: bump @typescript-eslint/parser from 2.25.0 to 2.26.0 (#200) 2020-03-30 18:32:54 +00:00
dependabot-preview[bot]
ca2c254157 deps: bump @typescript-eslint/eslint-plugin from 2.25.0 to 2.26.0 (#201) 2020-03-30 18:26:11 +00:00
dependabot-preview[bot]
3ed76c92c6 deps: bump lint-staged from 10.0.10 to 10.1.0 (#199) 2020-03-30 13:52:38 +00:00
dependabot-preview[bot]
e26a05e473 deps: bump ts-jest from 25.2.1 to 25.3.0 (#198) 2020-03-30 10:19:14 +00:00
peaceiris
d59e15bbd0 docs: Add github_token section 2020-03-30 17:31:13 +09:00
Shohei Ueda
3e53047dc0 docs: fix typo 2020-03-30 17:22:59 +09:00
dependabot-preview[bot]
339315a4b0 deps: bump jest from 25.2.3 to 25.2.4 (#197) 2020-03-29 19:58:23 +00:00
dependabot-preview[bot]
f5eb08fafc deps: bump jest-circus from 25.2.3 to 25.2.4 (#196) 2020-03-29 19:48:08 +00:00
Shohei Ueda
c276f65cf9 docs: Add link to interview (#194)
[GitHub Action Hero: Shohei Ueda - The GitHub Blog](https://github.blog/2020-03-22-github-action-hero-shohei-ueda/)
2020-03-29 23:36:47 +09:00
dependabot-preview[bot]
9dddc3350f deps: bump lint-staged from 10.0.9 to 10.0.10 (#195) 2020-03-29 13:33:34 +00:00
Shohei Ueda
0a1633ac31 ci: bump mdbook from 0.3.5 to 0.3.6 2020-03-29 18:19:30 +09:00
Shohei Ueda
164addf07d docs: bump mdbook from 0.3.5 to 0.3.6 2020-03-29 18:17:51 +09:00
Shohei Ueda
fbff0cd1e0 docs: Improve section name of enable_jekyll (#193) 2020-03-29 18:14:08 +09:00
Shohei Ueda
9597ab97de docs: bump node from 10 to 12 (#192) 2020-03-29 18:08:42 +09:00
Shohei Ueda
014420965c docs: Improve Docusaurus example (#191) 2020-03-29 15:53:22 +09:00
Shohei Ueda
87399813a5 docs: Improve Elm example (#190) 2020-03-29 15:20:03 +09:00
Shohei Ueda
2ea85f7322 docs: Improve Flutter example (#189) 2020-03-29 15:01:07 +09:00
dependabot-preview[bot]
e31acce9d3 deps: bump @types/node from 12.12.31 to 12.12.32 (#187) 2020-03-28 01:41:22 +00:00
dependabot-preview[bot]
25deb782d0 deps: bump jest from 25.2.2 to 25.2.3 (#186) 2020-03-26 21:03:58 +00:00
dependabot-preview[bot]
0e2b180da6 deps: bump jest-circus from 25.2.2 to 25.2.3 (#185) 2020-03-26 20:41:33 +00:00
dependabot-preview[bot]
1b904544aa deps: bump jest-circus from 25.2.1 to 25.2.2 (#183) 2020-03-26 19:05:13 +00:00
dependabot-preview[bot]
85823c67e1 deps: bump jest from 25.2.1 to 25.2.2 (#184) 2020-03-26 19:00:27 +00:00
Shohei Ueda
3183d3481b deps: bump git from 2.25.1 to 2.26.0 (#182) 2020-03-26 21:10:58 +09:00
dependabot-preview[bot]
2be10a7999 deps: bump jest-circus from 25.2.0 to 25.2.1 (#181) 2020-03-26 09:48:36 +00:00
dependabot-preview[bot]
9f0d4d44b9 deps: bump jest from 25.2.0 to 25.2.1 (#180) 2020-03-26 09:43:44 +00:00
dependabot-preview[bot]
669db9c5d1 deps: bump jest-circus from 25.1.0 to 25.2.0 (#178) 2020-03-25 18:25:06 +00:00
dependabot-preview[bot]
75680dae34 deps: bump jest from 25.1.0 to 25.2.0 (#179) 2020-03-25 18:17:22 +00:00
Shohei Ueda
465b328f75 ci: Add dev-image workflow (#177) 2020-03-25 19:37:45 +09:00
Shohei Ueda
7c4605913c chore: Add minify option to ncc 2020-03-25 19:36:13 +09:00
dependabot-preview[bot]
618acc18f3 deps: bump @types/node from 12.12.30 to 12.12.31 (#176) 2020-03-25 08:18:05 +00:00
dependabot-preview[bot]
36c6bd42bd deps: bump @types/js-yaml from 3.12.2 to 3.12.3 (#175) 2020-03-25 05:17:58 +00:00
dependabot-preview[bot]
bb022f3294 deps: bump lint-staged from 10.0.8 to 10.0.9 (#174) 2020-03-24 05:37:23 +00:00
dependabot-preview[bot]
1a3f0fd0f6 deps: bump @zeit/ncc from 0.21.1 to 0.22.0 (#172) 2020-03-24 03:16:45 +00:00
dependabot-preview[bot]
4933c8ef88 deps: bump prettier from 2.0.1 to 2.0.2 (#173) 2020-03-24 03:11:30 +00:00
dependabot-preview[bot]
ecd8e7bc48 deps: bump @typescript-eslint/eslint-plugin from 2.24.0 to 2.25.0 (#171) 2020-03-23 19:33:55 +00:00
dependabot-preview[bot]
04cd6de8fd deps: bump @typescript-eslint/parser from 2.24.0 to 2.25.0 (#170) 2020-03-23 19:27:58 +00:00
Albert
8019d941f3 feat: Set outputs.skip when action skipped
cf. #165
2020-03-22 16:16:36 +09:00
Shohei Ueda
cf8d655310 ci: comment out pull_request event 2020-03-22 16:09:54 +09:00
Shohei Ueda
6cf4da4de2 ci: Add GitHub context dump step [skip ci] 2020-03-22 16:06:43 +09:00
dependabot-preview[bot]
148a6573c6 deps: bump prettier from 1.19.1 to 2.0.1 (#167) 2020-03-22 06:57:08 +00:00
Shohei Ueda
0294e8c526 docs: bump actions/checkout to v2 in Hugo example 2020-03-21 12:51:05 +09:00
Shohei Ueda
2a787f0182 ci: set update_schedule live 2020-03-17 18:51:43 +09:00
dependabot-preview[bot]
62dcd84517 deps: bump @typescript-eslint/eslint-plugin from 2.23.0 to 2.24.0 (#162) 2020-03-17 02:31:36 +00:00
dependabot-preview[bot]
7c5e9bef11 deps: bump @typescript-eslint/parser from 2.23.0 to 2.24.0 (#161) 2020-03-17 02:22:47 +00:00
Shohei Ueda
3f58382eea chore: Print context for debug (#160)
* chore: Print context for debug
* fix: debug message
2020-03-16 13:56:58 +09:00
peaceiris
c50f9fd17d docs: Add link to example 2020-03-16 13:09:31 +09:00
peaceiris
1ee7d6e98a docs: Add path to workflow file 2020-03-16 13:05:28 +09:00
peaceiris
e2a54ec0b9 docs: Add github/personal-website
Add an example workflow for github/personal-website

https://github.com/github/personal-website
2020-03-16 13:01:54 +09:00
peaceiris
9794f98ff1 chore(release): Remove build assets [skip ci] 2020-03-16 12:03:50 +09:00
peaceiris
ba0b7df03e chore(release): 3.5.6
Some checks failed
Release / release (push) Has been cancelled
2020-03-16 12:03:50 +09:00
peaceiris
87a781f6ce chore(release): Add build assets 2020-03-16 12:03:49 +09:00
Shohei Ueda
6fa13fefb3 fix: skip on fork (#159) 2020-03-16 12:03:08 +09:00
peaceiris
efb69e1873 chore(release): Remove build assets [skip ci] 2020-03-16 11:49:23 +09:00
peaceiris
9d932c08b7 chore(release): 3.5.5
Some checks failed
Release / release (push) Has been cancelled
2020-03-16 11:49:22 +09:00
peaceiris
53c9fb0da1 chore(release): Add build assets 2020-03-16 11:49:22 +09:00
Shohei Ueda
d6bd6182f2 fix: skip on fork if pull_request (#158)
cf. #157
2020-03-16 11:48:40 +09:00
peaceiris
01fdaf2f02 chore: Add new task all 2020-03-16 00:43:59 +00:00
peaceiris
75c03d0413 chore(release): Remove build assets [skip ci] 2020-03-16 09:01:39 +09:00
peaceiris
ade70d3851 chore(release): 3.5.4
Some checks failed
Release / release (push) Has been cancelled
2020-03-16 09:01:38 +09:00
peaceiris
abaaadb545 chore(release): Add build assets 2020-03-16 09:01:37 +09:00
Shohei Ueda
4f06df820b fix: skip deployment on forks (#156)
* fix: skip on forks
* chore(release): 3.5.4-6

Close #153
2020-03-16 09:00:19 +09:00
peaceiris
ff31e77830 chore(release): Remove build assets [skip ci] 2020-03-14 06:50:48 +09:00
peaceiris
81f05c5524 chore(release): 3.5.3
Some checks failed
Release / release (push) Has been cancelled
2020-03-14 06:50:47 +09:00
peaceiris
60edcea535 chore(release): Add build assets 2020-03-14 06:50:46 +09:00
dependabot-preview[bot]
2fa0a59e21 deps: [security] bump acorn from 6.4.0 to 6.4.1 (#155) 2020-03-13 21:49:04 +00:00
dependabot-preview[bot]
d1f987783c deps: bump @types/node from 12.12.29 to 12.12.30 (#154) 2020-03-13 19:13:12 +00:00
peaceiris
0466bfb243 chore(release): Remove build assets [skip ci] 2020-03-12 23:24:13 +09:00
16 changed files with 2503 additions and 27888 deletions

View File

@@ -2,8 +2,29 @@ version: 1
update_configs: update_configs:
- package_manager: "javascript" - package_manager: "javascript"
directory: "/" directory: "/"
update_schedule: "daily" update_schedule: "live"
default_labels: default_labels:
- "dependencies" - "dependencies"
commit_message: commit_message:
prefix: "deps" prefix: "deps"
automerged_updates:
- match:
dependency_type: "development"
# Supported dependency types:
# - "development"
# - "production"
# - "all"
update_type: "all"
# Supported updates to automerge:
# - "security:patch"
# SemVer patch update that fixes a known security vulnerability
# - "semver:patch"
# SemVer patch update, e.g. > 1.x && 1.0.1 to 1.0.3
# - "semver:minor"
# SemVer minor update, e.g. > 1.x && 2.1.4 to 2.3.1
# - "in_range"
# matching the version requirement in your package manifest
# - "all"
- match:
dependency_type: "production"
update_type: "semver:patch"

37
.github/workflows/dev-image.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: 'Dev Image CI'
on:
push:
branches:
- master
paths:
- '.github/workflows/dev-image.yml'
- '.dockerignore'
- '.nvmrc'
- 'Dockerfile'
- 'Makefile'
pull_request:
types:
- opened
- synchronize
paths:
- '.github/workflows/dev-image.yml'
- '.dockerignore'
- '.nvmrc'
- 'Dockerfile'
- 'Makefile'
jobs:
skipci:
runs-on: ubuntu-18.04
steps:
- run: echo "[skip ci] ${{ contains(github.event.head_commit.message, '[skip ci]') }}"
dev-image-test:
runs-on: ubuntu-18.04
if: contains(github.event.head_commit.message, '[skip ci]') == false
steps:
- uses: actions/checkout@v2
- run: make build
- run: make cirun cmd="npm ci"
- run: make ciall

View File

@@ -1,17 +0,0 @@
name: "Stale"
on:
schedule:
- cron: "6 6 * * *"
jobs:
stale:
runs-on: ubuntu-18.04
steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-pr-message: 'This pull request is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
days-before-stale: 21
days-before-close: 7

View File

@@ -1,113 +0,0 @@
name: Test Action
on:
push:
branches:
- master
paths-ignore:
- '*.md'
pull_request:
types:
- opened
- synchronize
paths-ignore:
- '*.md'
jobs:
skipci:
runs-on: ubuntu-18.04
steps:
- run: echo "[Skip CI] ${{ contains(github.event.head_commit.message, '[skip ci]') }}"
test:
runs-on: ${{ matrix.os }}
if: contains(github.event.head_commit.message, '[skip ci]') == false
strategy:
max-parallel: 1
matrix:
os:
- 'ubuntu-18.04'
- 'macos-latest'
- 'windows-latest'
steps:
- uses: actions/checkout@v2
- name: Read .nvmrc
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
id: nvm
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- run: npm i -g npm
- name: Dump version
run: |
node -v
npm --version
git --version
- 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
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.3.5'
- name: Build
working-directory: ./test_projects/mdbook
run: mdbook build
- name: Prepare tag
id: prepare_tag
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_NAME="${GITHUB_REF##refs/tags/}"
echo "::set-output name=tag_name::${TAG_NAME}"
echo "::set-output name=deploy_tag_name::deploy-${TAG_NAME}"
- name: Deploy
if: matrix.os != 'windows-latest'
uses: ./
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
# github_token: ${{ secrets.GITHUB_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: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.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 }}'
- name: Deploy
if: matrix.os == 'windows-latest'
uses: ./
with:
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
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 }}'

View File

@@ -17,7 +17,7 @@ jobs:
skipci: skipci:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- run: echo "[Skip CI] ${{ contains(github.event.head_commit.message, '[skip ci]') }}" - run: echo "[skip ci] ${{ contains(github.event.head_commit.message, '[skip ci]') }}"
test: test:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -31,6 +31,11 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "${GITHUB_CONTEXT}"
- name: Read .nvmrc - name: Read .nvmrc
run: echo "::set-output name=NVMRC::$(cat .nvmrc)" run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
id: nvm id: nvm
@@ -58,10 +63,6 @@ jobs:
if: startsWith(matrix.os, 'ubuntu') if: startsWith(matrix.os, 'ubuntu')
run: npm run lint run: npm run lint
- name: Run ncc
if: startsWith(matrix.os, 'ubuntu')
run: npm run build
- run: npm test - run: npm test
- name: Upload test coverage as artifact - name: Upload test coverage as artifact
@@ -73,3 +74,80 @@ jobs:
- uses: codecov/codecov-action@v1 - uses: codecov/codecov-action@v1
with: with:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
- name: Run ncc
run: npm run build
- name: Remove lint-staged husky
if: github.ref == 'refs/heads/master'
run: |
npm uninstall lint-staged husky
git checkout package-lock.json package.json
- name: Setup mdBook
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.3.6'
- name: Build site
if: github.ref == 'refs/heads/master'
working-directory: ./test_projects/mdbook
run: mdbook build
- name: Deploy
if: |
startsWith(matrix.os, 'ubuntu') &&
github.ref == 'refs/heads/master'
uses: ./
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
# github_token: ${{ secrets.GITHUB_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: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
# commit_message: ${{ github.event.head_commit.message }}
cname: 'actions-gh-pages.peaceiris.com'
- name: Deploy
if: |
startsWith(matrix.os, 'macos') &&
github.ref == 'refs/heads/master'
uses: ./
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
# github_token: ${{ secrets.GITHUB_TOKEN }}
# personal_token: ${{ secrets.PERSONAL_TOKEN }}
publish_branch: gh-pages-macos
publish_dir: ./test_projects/mdbook/book
# external_repository: ''
allow_empty_commit: true
# keep_files: true
# force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
# commit_message: ${{ github.event.head_commit.message }}
- name: Deploy
if: |
startsWith(matrix.os, 'windows') &&
github.ref == 'refs/heads/master'
uses: ./
with:
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
# personal_token: ${{ secrets.PERSONAL_TOKEN }}
publish_branch: gh-pages-windows
publish_dir: ./test_projects/mdbook/book
# external_repository: ''
allow_empty_commit: true
# keep_files: true
# force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
# commit_message: ${{ github.event.head_commit.message }}

2
.nvmrc
View File

@@ -1 +1 @@
12.16.1 12.16.2

View File

@@ -2,6 +2,215 @@
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.5.7](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.6...v3.5.7) (2020-04-15)
### chore
* Add minify option to ncc ([7c46059](https://github.com/peaceiris/actions-gh-pages/commit/7c4605913c8e25e5bcb647c41df24622df973dea))
* bump node and npm (#232) ([8dd38be](https://github.com/peaceiris/actions-gh-pages/commit/8dd38bec4d0fe06da1c552846e91f1c9482eaa81)), closes [#232](https://github.com/peaceiris/actions-gh-pages/issues/232)
* Print context for debug (#160) ([3f58382](https://github.com/peaceiris/actions-gh-pages/commit/3f58382eeacaa13844a32b1499dd97073c0c134e)), closes [#160](https://github.com/peaceiris/actions-gh-pages/issues/160)
### ci
* Add automerged_updates ([6d889ad](https://github.com/peaceiris/actions-gh-pages/commit/6d889ad7e96ddde23d10af55c91bc853e7ae6875))
* Add cname ([3789ef4](https://github.com/peaceiris/actions-gh-pages/commit/3789ef4a0afefde589ddc2627f1e15c9b781bf8e))
* Add dev-image workflow (#177) ([465b328](https://github.com/peaceiris/actions-gh-pages/commit/465b328f7559c99f1baf1b953e51031e9e95cb3c)), closes [#177](https://github.com/peaceiris/actions-gh-pages/issues/177)
* Add GitHub context dump step [skip ci] ([6cf4da4](https://github.com/peaceiris/actions-gh-pages/commit/6cf4da4de2c6a448403c94c765853e21ec9c59d9))
* bump mdbook from 0.3.5 to 0.3.6 ([0a1633a](https://github.com/peaceiris/actions-gh-pages/commit/0a1633ac3140c8be2e2eded5961aa2a17831328e))
* comment out pull_request event ([cf8d655](https://github.com/peaceiris/actions-gh-pages/commit/cf8d65531019ee6fb9bae2ce615c7c7735073cac))
* delete stale workflow ([98e0f60](https://github.com/peaceiris/actions-gh-pages/commit/98e0f6025c650cd5e0bafe454a78754e170fd08d))
* Merge test workflows (#204) ([ed5a99d](https://github.com/peaceiris/actions-gh-pages/commit/ed5a99d6377a295a05189f1dac5bc9e32739fced)), closes [#204](https://github.com/peaceiris/actions-gh-pages/issues/204)
* set update_schedule live ([2a787f0](https://github.com/peaceiris/actions-gh-pages/commit/2a787f018275ed6400c555b0144e8f15b9c3db4f))
### deps
* bump @types/jest from 25.1.4 to 25.1.5 (#208) ([78d67e4](https://github.com/peaceiris/actions-gh-pages/commit/78d67e4cbe7435ac1848ba5f4e5be1598dd0f843)), closes [#208](https://github.com/peaceiris/actions-gh-pages/issues/208)
* bump @types/jest from 25.1.5 to 25.2.1 (#213) ([37ce049](https://github.com/peaceiris/actions-gh-pages/commit/37ce049d087d29dae2d276e0df6665258c979d66)), closes [#213](https://github.com/peaceiris/actions-gh-pages/issues/213)
* bump @types/js-yaml from 3.12.2 to 3.12.3 (#175) ([36c6bd4](https://github.com/peaceiris/actions-gh-pages/commit/36c6bd42bd9f29c9b6b8e157bd9e41da701fb77e)), closes [#175](https://github.com/peaceiris/actions-gh-pages/issues/175)
* bump @types/node from 12.12.30 to 12.12.31 (#176) ([618acc1](https://github.com/peaceiris/actions-gh-pages/commit/618acc18f38ea8866cb92509e5a1fb33e5b475cb)), closes [#176](https://github.com/peaceiris/actions-gh-pages/issues/176)
* bump @types/node from 12.12.31 to 12.12.32 (#187) ([e31acce](https://github.com/peaceiris/actions-gh-pages/commit/e31acce9d332395ce09ec79567979ad6afc2083a)), closes [#187](https://github.com/peaceiris/actions-gh-pages/issues/187)
* bump @types/node from 12.12.32 to 12.12.34 (#203) ([45a2a58](https://github.com/peaceiris/actions-gh-pages/commit/45a2a58fb026bdd007fc960472e4c64cac3d1742)), closes [#203](https://github.com/peaceiris/actions-gh-pages/issues/203)
* bump @types/node from 12.12.34 to 12.12.35 (#222) ([8af9b8c](https://github.com/peaceiris/actions-gh-pages/commit/8af9b8c0d5a79ac59deca7c805b3dbb2f27b6637)), closes [#222](https://github.com/peaceiris/actions-gh-pages/issues/222)
* bump @typescript-eslint/eslint-plugin from 2.23.0 to 2.24.0 (#162) ([62dcd84](https://github.com/peaceiris/actions-gh-pages/commit/62dcd84517adc033e68d52d0a32e2d5edaa1a3c3)), closes [#162](https://github.com/peaceiris/actions-gh-pages/issues/162)
* bump @typescript-eslint/eslint-plugin from 2.24.0 to 2.25.0 (#171) ([ecd8e7b](https://github.com/peaceiris/actions-gh-pages/commit/ecd8e7bc48e57d3ea82184116fa1710c425d57a6)), closes [#171](https://github.com/peaceiris/actions-gh-pages/issues/171)
* bump @typescript-eslint/eslint-plugin from 2.25.0 to 2.26.0 (#201) ([ca2c254](https://github.com/peaceiris/actions-gh-pages/commit/ca2c2541577d3e41f6c7c2265430a219b974c314)), closes [#201](https://github.com/peaceiris/actions-gh-pages/issues/201)
* bump @typescript-eslint/eslint-plugin from 2.26.0 to 2.27.0 (#219) ([046c703](https://github.com/peaceiris/actions-gh-pages/commit/046c703d6daeac7f9c32fbd0adf9f1412b025361)), closes [#219](https://github.com/peaceiris/actions-gh-pages/issues/219)
* bump @typescript-eslint/eslint-plugin from 2.27.0 to 2.28.0 (#231) ([ddf2c5b](https://github.com/peaceiris/actions-gh-pages/commit/ddf2c5b9f16b38116d8f194ed9804fe079d950ca)), closes [#231](https://github.com/peaceiris/actions-gh-pages/issues/231)
* bump @typescript-eslint/parser from 2.23.0 to 2.24.0 (#161) ([7c5e9be](https://github.com/peaceiris/actions-gh-pages/commit/7c5e9bef11bc4c1a57fd1f7794c93518f320293d)), closes [#161](https://github.com/peaceiris/actions-gh-pages/issues/161)
* bump @typescript-eslint/parser from 2.24.0 to 2.25.0 (#170) ([04cd6de](https://github.com/peaceiris/actions-gh-pages/commit/04cd6de8fd7f30f0c3c725e3981a6f8e549f19fa)), closes [#170](https://github.com/peaceiris/actions-gh-pages/issues/170)
* bump @typescript-eslint/parser from 2.25.0 to 2.26.0 (#200) ([042b824](https://github.com/peaceiris/actions-gh-pages/commit/042b824d8bb5cde606db907ffc0edd525b9557f1)), closes [#200](https://github.com/peaceiris/actions-gh-pages/issues/200)
* bump @typescript-eslint/parser from 2.26.0 to 2.27.0 (#218) ([da14e08](https://github.com/peaceiris/actions-gh-pages/commit/da14e086461d30a80a0c62fb0ee531635c021a92)), closes [#218](https://github.com/peaceiris/actions-gh-pages/issues/218)
* bump @typescript-eslint/parser from 2.27.0 to 2.28.0 (#230) ([d8356e3](https://github.com/peaceiris/actions-gh-pages/commit/d8356e3cf1b99104b423cfeb405751ce358b46f1)), closes [#230](https://github.com/peaceiris/actions-gh-pages/issues/230)
* bump @zeit/ncc from 0.21.1 to 0.22.0 (#172) ([1a3f0fd](https://github.com/peaceiris/actions-gh-pages/commit/1a3f0fd0f6ec1a0544e7489db322e559823f3538)), closes [#172](https://github.com/peaceiris/actions-gh-pages/issues/172)
* bump @zeit/ncc from 0.22.0 to 0.22.1 (#215) ([711b0ed](https://github.com/peaceiris/actions-gh-pages/commit/711b0ed1cd911cef0808ec5fe090f240fb3e804e)), closes [#215](https://github.com/peaceiris/actions-gh-pages/issues/215)
* bump git from 2.25.1 to 2.26.0 (#182) ([3183d34](https://github.com/peaceiris/actions-gh-pages/commit/3183d3481b7ef83750e6365ea9f28258df85c5f7)), closes [#182](https://github.com/peaceiris/actions-gh-pages/issues/182)
* bump git from 2.26.0 to 2.26.1 (#233) ([df5698c](https://github.com/peaceiris/actions-gh-pages/commit/df5698c4aaaf8edee82ce0d2799caddde3d2f6bc)), closes [#233](https://github.com/peaceiris/actions-gh-pages/issues/233)
* bump husky from 4.2.3 to 4.2.4 (#225) ([abd7ea5](https://github.com/peaceiris/actions-gh-pages/commit/abd7ea550b2efa7ba4353ed178a5cceab5741b4e)), closes [#225](https://github.com/peaceiris/actions-gh-pages/issues/225)
* bump husky from 4.2.4 to 4.2.5 (#226) ([bf8dc2c](https://github.com/peaceiris/actions-gh-pages/commit/bf8dc2ce19690fde3f8f875f0b56726a8467f043)), closes [#226](https://github.com/peaceiris/actions-gh-pages/issues/226)
* bump jest from 25.1.0 to 25.2.0 (#179) ([75680da](https://github.com/peaceiris/actions-gh-pages/commit/75680dae34ad8b6811ee6482a809d0be3f24c743)), closes [#179](https://github.com/peaceiris/actions-gh-pages/issues/179)
* bump jest from 25.2.0 to 25.2.1 (#180) ([9f0d4d4](https://github.com/peaceiris/actions-gh-pages/commit/9f0d4d44b9782b3baa0c97b515061b16a78a4ccd)), closes [#180](https://github.com/peaceiris/actions-gh-pages/issues/180)
* bump jest from 25.2.1 to 25.2.2 (#184) ([85823c6](https://github.com/peaceiris/actions-gh-pages/commit/85823c67e1a6ee02bca13ad66bdedcaf932f7fb8)), closes [#184](https://github.com/peaceiris/actions-gh-pages/issues/184)
* bump jest from 25.2.2 to 25.2.3 (#186) ([25deb78](https://github.com/peaceiris/actions-gh-pages/commit/25deb782d00a799f89ae56a01471de34eb584507)), closes [#186](https://github.com/peaceiris/actions-gh-pages/issues/186)
* bump jest from 25.2.3 to 25.2.4 (#197) ([339315a](https://github.com/peaceiris/actions-gh-pages/commit/339315a4b0911f7ba5f46b48517303a51ab3c9de)), closes [#197](https://github.com/peaceiris/actions-gh-pages/issues/197)
* bump jest from 25.2.4 to 25.2.6 (#207) ([af6a597](https://github.com/peaceiris/actions-gh-pages/commit/af6a5970d8665fe405d2d41739a205fb02c3c82b)), closes [#207](https://github.com/peaceiris/actions-gh-pages/issues/207)
* bump jest from 25.2.6 to 25.2.7 (#210) ([7f9aba2](https://github.com/peaceiris/actions-gh-pages/commit/7f9aba2ea85c816a7bc7d764386db0d22fb27664)), closes [#210](https://github.com/peaceiris/actions-gh-pages/issues/210)
* bump jest from 25.2.7 to 25.3.0 (#221) ([a07d711](https://github.com/peaceiris/actions-gh-pages/commit/a07d7115c5ba0974e1cc521c12f921344a5cb740)), closes [#221](https://github.com/peaceiris/actions-gh-pages/issues/221)
* bump jest-circus from 25.1.0 to 25.2.0 (#178) ([669db9c](https://github.com/peaceiris/actions-gh-pages/commit/669db9c5d1ea78f2fe5e844401803de4ebd79516)), closes [#178](https://github.com/peaceiris/actions-gh-pages/issues/178)
* bump jest-circus from 25.2.0 to 25.2.1 (#181) ([2be10a7](https://github.com/peaceiris/actions-gh-pages/commit/2be10a799985a223581c2368b866882d2a13515c)), closes [#181](https://github.com/peaceiris/actions-gh-pages/issues/181)
* bump jest-circus from 25.2.1 to 25.2.2 (#183) ([1b90454](https://github.com/peaceiris/actions-gh-pages/commit/1b904544aa6f23628ab65efd7399f9b22406bddf)), closes [#183](https://github.com/peaceiris/actions-gh-pages/issues/183)
* bump jest-circus from 25.2.2 to 25.2.3 (#185) ([0e2b180](https://github.com/peaceiris/actions-gh-pages/commit/0e2b180da6b0035c64940c6fcbcdfd16fc02ab1f)), closes [#185](https://github.com/peaceiris/actions-gh-pages/issues/185)
* bump jest-circus from 25.2.3 to 25.2.4 (#196) ([f5eb08f](https://github.com/peaceiris/actions-gh-pages/commit/f5eb08fafcb4f22c6636badd1d35676cfec90f57)), closes [#196](https://github.com/peaceiris/actions-gh-pages/issues/196)
* bump jest-circus from 25.2.4 to 25.2.6 (#206) ([7c0ae72](https://github.com/peaceiris/actions-gh-pages/commit/7c0ae727e6ff477fc420bd0fc74f6c706b433508)), closes [#206](https://github.com/peaceiris/actions-gh-pages/issues/206)
* bump jest-circus from 25.2.6 to 25.2.7 (#209) ([c742786](https://github.com/peaceiris/actions-gh-pages/commit/c742786fc9fe33aa256482960f82f3e9e3e7e591)), closes [#209](https://github.com/peaceiris/actions-gh-pages/issues/209)
* bump jest-circus from 25.2.7 to 25.3.0 (#220) ([20e19cf](https://github.com/peaceiris/actions-gh-pages/commit/20e19cf1eb238cb2bdeb1ce8c4a586586433b1ab)), closes [#220](https://github.com/peaceiris/actions-gh-pages/issues/220)
* bump lint-staged from 10.0.10 to 10.1.0 (#199) ([3ed76c9](https://github.com/peaceiris/actions-gh-pages/commit/3ed76c92c68fe6ce8abdec7c18ce08cd4fc73f5d)), closes [#199](https://github.com/peaceiris/actions-gh-pages/issues/199)
* bump lint-staged from 10.0.8 to 10.0.9 (#174) ([bb022f3](https://github.com/peaceiris/actions-gh-pages/commit/bb022f3294a46c3cb76aabad2a3c6256f4d94f4a)), closes [#174](https://github.com/peaceiris/actions-gh-pages/issues/174)
* bump lint-staged from 10.0.9 to 10.0.10 (#195) ([9dddc33](https://github.com/peaceiris/actions-gh-pages/commit/9dddc3350fb83f9b17f09d2ae0df8cfe821d3091)), closes [#195](https://github.com/peaceiris/actions-gh-pages/issues/195)
* bump lint-staged from 10.1.0 to 10.1.1 (#205) ([42a3ae6](https://github.com/peaceiris/actions-gh-pages/commit/42a3ae6a382b047d97c25c18d069c9403b957d2f)), closes [#205](https://github.com/peaceiris/actions-gh-pages/issues/205)
* bump lint-staged from 10.1.1 to 10.1.2 (#214) ([e5063fa](https://github.com/peaceiris/actions-gh-pages/commit/e5063fa6dd73e5a0d63f79a29ce874029949af00)), closes [#214](https://github.com/peaceiris/actions-gh-pages/issues/214)
* bump lint-staged from 10.1.2 to 10.1.3 (#224) ([ab7b255](https://github.com/peaceiris/actions-gh-pages/commit/ab7b25543231b886faf8f1cf63fd5085eeedf796)), closes [#224](https://github.com/peaceiris/actions-gh-pages/issues/224)
* bump node 12.16.1 to 12.16.2 (#223) ([6fcf128](https://github.com/peaceiris/actions-gh-pages/commit/6fcf128c187d621040cda918d737c816339b2268)), closes [#223](https://github.com/peaceiris/actions-gh-pages/issues/223)
* bump prettier from 1.19.1 to 2.0.1 (#167) ([148a657](https://github.com/peaceiris/actions-gh-pages/commit/148a6573c6b840a7235933a411b6807f0914adc0)), closes [#167](https://github.com/peaceiris/actions-gh-pages/issues/167)
* bump prettier from 2.0.1 to 2.0.2 (#173) ([4933c8e](https://github.com/peaceiris/actions-gh-pages/commit/4933c8ef88a7aba30905620f3b3cd2b2c516dd19)), closes [#173](https://github.com/peaceiris/actions-gh-pages/issues/173)
* bump prettier from 2.0.2 to 2.0.4 (#217) ([ab37125](https://github.com/peaceiris/actions-gh-pages/commit/ab371259dd262501f100a0b6fdbe4231200e8938)), closes [#217](https://github.com/peaceiris/actions-gh-pages/issues/217)
* bump ts-jest from 25.2.1 to 25.3.0 (#198) ([e26a05e](https://github.com/peaceiris/actions-gh-pages/commit/e26a05e4739a55410254da8777766f46eab5826a)), closes [#198](https://github.com/peaceiris/actions-gh-pages/issues/198)
* bump ts-jest from 25.3.0 to 25.3.1 (#211) ([d48d5de](https://github.com/peaceiris/actions-gh-pages/commit/d48d5de82e47f8e4fd718b2ec979301a99cb7202)), closes [#211](https://github.com/peaceiris/actions-gh-pages/issues/211)
* npm audit fix ([58be994](https://github.com/peaceiris/actions-gh-pages/commit/58be9948094654ed7853e644e1fe29310c1325f2))
### docs
* Add branches ([596c2d5](https://github.com/peaceiris/actions-gh-pages/commit/596c2d55482b737210a851c25ba572f61685c85e))
* Add fetch-depth 0 ([32a0227](https://github.com/peaceiris/actions-gh-pages/commit/32a0227f7c6301faaa80bd5680eb93e5e049996f))
* Add github_token section ([d59e15b](https://github.com/peaceiris/actions-gh-pages/commit/d59e15bbd09dea2d67fca9947f5526fe0e718b63))
* Add github/personal-website ([e2a54ec](https://github.com/peaceiris/actions-gh-pages/commit/e2a54ec0b920afe6f8108d1b0237cd7963faafc2))
* Add link to example ([c50f9fd](https://github.com/peaceiris/actions-gh-pages/commit/c50f9fd17d0d1d6d24b4c45c4e6e09ea9187536f))
* Add link to interview (#194) ([c276f65](https://github.com/peaceiris/actions-gh-pages/commit/c276f65cf9ffa972e8f2cd4c358120bebb357c3f)), closes [#194](https://github.com/peaceiris/actions-gh-pages/issues/194)
* Add path to workflow file ([1ee7d6e](https://github.com/peaceiris/actions-gh-pages/commit/1ee7d6e98a5634528769f1e28d7982706cf0356c))
* Add Swift Publish example (#228) ([9f90987](https://github.com/peaceiris/actions-gh-pages/commit/9f90987bad7ac98d4f0c2dbad6b95ca3d2471102)), closes [#228](https://github.com/peaceiris/actions-gh-pages/issues/228) [#227](https://github.com/peaceiris/actions-gh-pages/issues/227)
* bump actions/checkout to v2 in Hugo example ([0294e8c](https://github.com/peaceiris/actions-gh-pages/commit/0294e8c526ec496925ffbef19885cc57d2ab0383))
* bump hugo and mdbook ([b6bc504](https://github.com/peaceiris/actions-gh-pages/commit/b6bc5040aafba38af3782d27801d58f2a06ddd6f))
* bump mdbook from 0.3.5 to 0.3.6 ([164addf](https://github.com/peaceiris/actions-gh-pages/commit/164addf07d7d653dd193300a4828d00437c56b65))
* bump node from 10 to 12 (#192) ([9597ab9](https://github.com/peaceiris/actions-gh-pages/commit/9597ab97de490652c80824ee63060736af58c369)), closes [#192](https://github.com/peaceiris/actions-gh-pages/issues/192)
* fix typo ([3e53047](https://github.com/peaceiris/actions-gh-pages/commit/3e53047dc0f67282685d350dd6a0e3342c70d20f))
* Improve Docusaurus example (#191) ([0144209](https://github.com/peaceiris/actions-gh-pages/commit/014420965cfc3721de582be7a7c01ec36b5b1d21)), closes [#191](https://github.com/peaceiris/actions-gh-pages/issues/191)
* Improve Elm example (#190) ([8739981](https://github.com/peaceiris/actions-gh-pages/commit/87399813a5eb5ec3a73d11719066dceff2620582)), closes [#190](https://github.com/peaceiris/actions-gh-pages/issues/190)
* Improve Flutter example (#189) ([2ea85f7](https://github.com/peaceiris/actions-gh-pages/commit/2ea85f732266fec9726a6b32856b338dfe36f056)), closes [#189](https://github.com/peaceiris/actions-gh-pages/issues/189)
* Improve section name of enable_jekyll (#193) ([fbff0cd](https://github.com/peaceiris/actions-gh-pages/commit/fbff0cd1e0680c9ff1a9ffd34306fb2199308eac)), closes [#193](https://github.com/peaceiris/actions-gh-pages/issues/193)
* update ([9614091](https://github.com/peaceiris/actions-gh-pages/commit/9614091a5e44b16c3add28e53671146a91dbfbe4))
* Update Docusaurus workflow example (#229) ([fb15409](https://github.com/peaceiris/actions-gh-pages/commit/fb15409be9a17556fc8c4b2335735466e8b8347b)), closes [#229](https://github.com/peaceiris/actions-gh-pages/issues/229)
* update test badge ([a93c85c](https://github.com/peaceiris/actions-gh-pages/commit/a93c85ca96782d06b7c1f68e0d1bd7d337cf40cb))
### feat
* Set outputs.skip when action skipped ([8019d94](https://github.com/peaceiris/actions-gh-pages/commit/8019d941f376d6f650735a88216bf5baebb7f397)), closes [#165](https://github.com/peaceiris/actions-gh-pages/issues/165)
## [3.5.6](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.5...v3.5.6) (2020-03-16)
### fix
* skip on fork (#159) ([6fa13fe](https://github.com/peaceiris/actions-gh-pages/commit/6fa13fefb393227eec5c9710d92e8bffa917546a)), closes [#159](https://github.com/peaceiris/actions-gh-pages/issues/159)
## [3.5.5](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.4...v3.5.5) (2020-03-16)
### chore
* Add new task all ([01fdaf2](https://github.com/peaceiris/actions-gh-pages/commit/01fdaf2f0274401d2403c809b20c37fb7a8535a6))
### fix
* skip on fork if pull_request (#158) ([d6bd618](https://github.com/peaceiris/actions-gh-pages/commit/d6bd6182f264ce695613180743d42e377570bbf4)), closes [#158](https://github.com/peaceiris/actions-gh-pages/issues/158) [#157](https://github.com/peaceiris/actions-gh-pages/issues/157)
## [3.5.4](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.3...v3.5.4) (2020-03-16)
### fix
* skip deployment on forks (#156) ([4f06df8](https://github.com/peaceiris/actions-gh-pages/commit/4f06df820b7a5882e2faef0e6929bb670140fba0)), closes [#156](https://github.com/peaceiris/actions-gh-pages/issues/156) [#153](https://github.com/peaceiris/actions-gh-pages/issues/153)
## [3.5.4-6](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.4-5...v3.5.4-6) (2020-03-15)
### fix
* skip logic ([44bdada](https://github.com/peaceiris/actions-gh-pages/commit/44bdada02c71f646d23ffefe1ea07d16386dbf83))
## [3.5.4-5](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.4-4...v3.5.4-5) (2020-03-14)
### fix
* property access ([72f58a0](https://github.com/peaceiris/actions-gh-pages/commit/72f58a06cf5db88d3eb982f57de8dbc266e39232))
## [3.5.4-4](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.4-3...v3.5.4-4) (2020-03-14)
### test
* skipOnFork() ([6f9a5b7](https://github.com/peaceiris/actions-gh-pages/commit/6f9a5b7a66bbf855cadc34099fa6450c40eff4a2))
## [3.5.4-3](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.4-2...v3.5.4-3) (2020-03-14)
### fix
* skip logic ([01976c9](https://github.com/peaceiris/actions-gh-pages/commit/01976c9d9b95b42997caa2a85c2d737eb75e852e))
## [3.5.4-2](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.4-1...v3.5.4-2) (2020-03-14)
### fix
* skip logic ([c97a39a](https://github.com/peaceiris/actions-gh-pages/commit/c97a39a35f681badbf7490c2786eddf06b17316d))
## [3.5.4-1](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.4-0...v3.5.4-1) (2020-03-14)
### fix
* isForkRepository ([6546aa9](https://github.com/peaceiris/actions-gh-pages/commit/6546aa96085e89bd91adc56f58be665766e93a1e))
## [3.5.4-0](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.3...v3.5.4-0) (2020-03-14)
### fix
* skip on forks ([c320668](https://github.com/peaceiris/actions-gh-pages/commit/c320668126b104ad2c15ea1b583a75cd3978c2f3)), closes [#153](https://github.com/peaceiris/actions-gh-pages/issues/153)
## [3.5.3](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.2...v3.5.3) (2020-03-13)
### deps
* [security] bump acorn from 6.4.0 to 6.4.1 (#155) ([2fa0a59](https://github.com/peaceiris/actions-gh-pages/commit/2fa0a59e21f19c0862ebc505187b3ede95a92561)), closes [#155](https://github.com/peaceiris/actions-gh-pages/issues/155)
* bump @types/node from 12.12.29 to 12.12.30 (#154) ([d1f9877](https://github.com/peaceiris/actions-gh-pages/commit/d1f987783c05614c72b8c5009fbfd941982128ec)), closes [#154](https://github.com/peaceiris/actions-gh-pages/issues/154)
## [3.5.2](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.1...v3.5.2) (2020-03-12) ## [3.5.2](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.1...v3.5.2) (2020-03-12)

View File

@@ -16,7 +16,7 @@ RUN apt-get update && \
npm i -g npm npm i -g npm
WORKDIR /git WORKDIR /git
ENV GIT_VERSION="2.25.1" ENV GIT_VERSION="2.26.1"
RUN wget -q "https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz" && \ RUN wget -q "https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz" && \
tar -zxf "./v${GIT_VERSION}.tar.gz" && \ tar -zxf "./v${GIT_VERSION}.tar.gz" && \
rm "./v${GIT_VERSION}.tar.gz" && \ rm "./v${GIT_VERSION}.tar.gz" && \

View File

@@ -4,6 +4,7 @@ IMAGE_NAME := actions_github_pages_dev:latest
NODE_VERSION := $(shell cat ./.nvmrc) NODE_VERSION := $(shell cat ./.nvmrc)
DOCKER_BUILD := docker build . -t $(IMAGE_NAME) --build-arg NODE_VERSION=$(NODE_VERSION) DOCKER_BUILD := docker build . -t $(IMAGE_NAME) --build-arg NODE_VERSION=$(NODE_VERSION)
DOCKER_RUN := docker run --rm -i -t -v ${PWD}:/repo -v ~/.gitconfig:/root/.gitconfig $(IMAGE_NAME) DOCKER_RUN := docker run --rm -i -t -v ${PWD}:/repo -v ~/.gitconfig:/root/.gitconfig $(IMAGE_NAME)
DOCKER_RUN_CI := docker run --rm -v ${PWD}:/repo $(IMAGE_NAME)
.PHONY: build .PHONY: build
@@ -14,6 +15,10 @@ build:
run: run:
$(DOCKER_RUN) $(cmd) $(DOCKER_RUN) $(cmd)
.PHONY: cirun
cirun:
$(DOCKER_RUN_CI) $(cmd)
.PHONY: test .PHONY: test
test: test:
$(DOCKER_RUN) npm test $(DOCKER_RUN) npm test
@@ -21,3 +26,11 @@ test:
.PHONY: commit .PHONY: commit
commit: commit:
$(DOCKER_RUN) git commit -m "$(msg)" $(DOCKER_RUN) git commit -m "$(msg)"
.PHONY: all
all:
$(DOCKER_RUN) npm run all
.PHONY: ciall
ciall:
$(DOCKER_RUN_CI) npm run all

182
README.md
View File

@@ -1,16 +1,15 @@
[![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)
![Test Action](https://github.com/peaceiris/actions-gh-pages/workflows/Test%20Action/badge.svg?branch=master&event=push) ![Test](https://github.com/peaceiris/actions-gh-pages/workflows/Test/badge.svg?branch=master&event=push)
[![CodeFactor](https://www.codefactor.io/repository/github/peaceiris/actions-gh-pages/badge)](https://www.codefactor.io/repository/github/peaceiris/actions-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). 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)
> The old Docker Action is [peaceiris/actions-gh-pages@v2](https://github.com/peaceiris/actions-gh-pages/tree/v2)
@@ -42,7 +41,7 @@ Three tokens are supported.
| `deploy_key` | ✅️ | ✅️ | SSH | Necessary | | `deploy_key` | ✅️ | ✅️ | SSH | Necessary |
| `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. For the first deployment, we need to select the `gh-pages` branch or `master` branch on the repository settings tab. See [First Deployment with `GITHUB_TOKEN`](#%EF%B8%8F-first-deployment-with-github_token) 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. See [First Deployment with `GITHUB_TOKEN`](#%EF%B8%8F-first-deployment-with-github_token)
### Supported Platforms ### Supported Platforms
@@ -66,10 +65,11 @@ Notes: Actually, the `GitHub_TOKEN` works for deploying to GitHub Pages but it h
- [⭐️ 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)
- [⭐️ `github_token`](#%EF%B8%8F-github_token)
- [⭐️ `deploy_key`](#%EF%B8%8F-deploy_key) - [⭐️ `deploy_key`](#%EF%B8%8F-deploy_key)
- [⭐️ `personal_token`](#%EF%B8%8F-personal_token) - [⭐️ `personal_token`](#%EF%B8%8F-personal_token)
- [⭐️ CNAME](#%EF%B8%8F-cname) - [⭐️ CNAME](#%EF%B8%8F-cname)
- [⭐️ Enable Jekyll](#%EF%B8%8F-enable-jekyll) - [⭐️ Enable Built-in Jekyll](#%EF%B8%8F-enable-built-in-jekyll)
- [⭐️ Allow empty commits](#%EF%B8%8F-allow-empty-commits) - [⭐️ Allow empty commits](#%EF%B8%8F-allow-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)
@@ -91,6 +91,8 @@ Notes: Actually, the `GitHub_TOKEN` works for deploying to GitHub Pages but it h
- [⭐️ mdBook (Rust)](#%EF%B8%8F-mdbook-rust) - [⭐️ mdBook (Rust)](#%EF%B8%8F-mdbook-rust)
- [⭐️ Flutter Web](#%EF%B8%8F-flutter-web) - [⭐️ Flutter Web](#%EF%B8%8F-flutter-web)
- [⭐️ Elm](#%EF%B8%8F-elm) - [⭐️ Elm](#%EF%B8%8F-elm)
- [⭐️ github/personal-website](#%EF%B8%8F-githubpersonal-website)
- [⭐️ Swift Publish](#%EF%B8%8F-swift-publish)
- [License](#license) - [License](#license)
- [Maintainer](#maintainer) - [Maintainer](#maintainer)
@@ -122,14 +124,15 @@ jobs:
deploy: deploy:
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
# with: with:
# submodules: true submodules: true # Fetch Hugo themes
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo - name: Setup Hugo
uses: peaceiris/actions-hugo@v2 uses: peaceiris/actions-hugo@v2
with: with:
hugo-version: '0.64.0' hugo-version: '0.68.3'
- name: Build - name: Build
run: hugo --minify run: hugo --minify
@@ -190,6 +193,22 @@ jobs:
## Options ## Options
### ⭐️ `github_token`
**This option is for `GITHUB_TOKEN`, not a personal access token.**
GitHub Actions runner automatically creates a `GITHUB_TOKEN` secret to use in your workflow. You can use the `GITHUB_TOKEN` to authenticate in a workflow run.
```yaml
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
```
For more details about `GITHUB_TOKEN`: [Authenticating with the GITHUB_TOKEN - GitHub Help](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token)
### ⭐️ `deploy_key` ### ⭐️ `deploy_key`
Read [Create SSH Deploy Key](#%EF%B8%8F-create-ssh-deploy-key), create your SSH deploy key, and set the `deploy_key` option like the following. Read [Create SSH Deploy Key](#%EF%B8%8F-create-ssh-deploy-key), create your SSH deploy key, and set the `deploy_key` option like the following.
@@ -230,9 +249,11 @@ For more details about `CNAME`, read the official documentation: [Managing a cus
cname: github.com cname: github.com
``` ```
### ⭐️ Enable Jekyll ### ⭐️ Enable Built-in Jekyll
If you want GitHub Pages to process the site with the static site generator Jekyll, set `enable_jekyll` to true. If you want GitHub Pages to process your site with the static site generator Jekyll, set `enable_jekyll` to true.
[github/personal-website](https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-githubpersonal-website) is one of the examples using GitHub Pages built-in Jekyll.
By default, this action signals to GitHub Pages that the site shall not be processed with Jekyll. This is done by adding an empty `.nojekyll` file when publishing to the master or gh-pages branch. When a `.nojekyll` file already exists, this action does nothing. By default, this action signals to GitHub Pages that the site shall not be processed with Jekyll. This is done by adding an empty `.nojekyll` file when publishing to the master or gh-pages branch. When a `.nojekyll` file already exists, this action does nothing.
@@ -488,7 +509,7 @@ jobs:
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: '10.x' node-version: '12.x'
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v1 uses: actions/cache@v1
@@ -532,7 +553,7 @@ jobs:
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: '10.x' node-version: '12.x'
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v1 uses: actions/cache@v1
@@ -580,7 +601,7 @@ jobs:
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: '10.x' node-version: '12.x'
- name: Get yarn cache - name: Get yarn cache
id: yarn-cache id: yarn-cache
@@ -631,7 +652,7 @@ jobs:
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: '10.x' node-version: '12.x'
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v1 uses: actions/cache@v1
@@ -654,12 +675,9 @@ jobs:
### ⭐️ Docusaurus ### ⭐️ Docusaurus
An example for pages created using [Docusaurus](https://docusaurus.io/). An example workflow for [Docusaurus](https://docusaurus.io/).
Examples where this is being used: `npx @docusaurus/init@next init website classic` is useful to create a new Docusaurus project.
- [Mittens](https://github.com/ExpediaGroup/mittens)
- [graphql-kotlin](https://github.com/ExpediaGroup/graphql-kotlin)
```yaml ```yaml
name: github pages name: github pages
@@ -668,9 +686,6 @@ on:
push: push:
branches: branches:
- master - master
paths:
- 'docs/**'
- 'website/**'
jobs: jobs:
deploy: deploy:
@@ -681,28 +696,30 @@ jobs:
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 12 node-version: '12.x'
- name: Get yarn cache
id: yarn-cache
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: ~/.npm path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('website/package-lock.json') }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-node- ${{ runner.os }}-yarn-
- name: Build - run: yarn install
run: | working-directory: ./website
cd website - run: yarn build
npm ci working-directory: ./website
npm run build
- 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 }}
# use the projectName from your siteConfig.js file: https://docusaurus.io/docs/en/site-config#projectname-string publish_dir: ./website/build
publish_dir: ./website/build/<projectName>
``` ```
### ⭐️ Static Site Generators with Python ### ⭐️ Static Site Generators with Python
@@ -782,7 +799,7 @@ jobs:
- name: Setup mdBook - name: Setup mdBook
uses: peaceiris/actions-mdbook@v1 uses: peaceiris/actions-mdbook@v1
with: with:
mdbook-version: '0.3.5' mdbook-version: '0.3.7'
# mdbook-version: 'latest' # mdbook-version: 'latest'
- run: mdbook build - run: mdbook build
@@ -797,14 +814,8 @@ jobs:
### ⭐️ Flutter Web ### ⭐️ Flutter Web
An exapmle workflow for [Flutter web project]. An exapmle workflow for [Flutter web project].
Setup [Flutter] with [subosito/flutter-action].
[peanut | Dart Package] is also useful.
[Flutter]: https://github.com/flutter/flutter
[Flutter web project]: https://flutter.dev/docs/get-started/web [Flutter web project]: https://flutter.dev/docs/get-started/web
[subosito/flutter-action]: https://github.com/subosito/flutter-action
[peanut | Dart Package]: https://pub.dev/packages/peanut
```yaml ```yaml
name: github pages name: github pages
@@ -821,9 +832,9 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Setup Flutter - name: Setup Flutter
uses: subosito/flutter-action@v1 run: |
with: git clone https://github.com/flutter/flutter.git --depth 1 -b beta _flutter
channel: 'beta' echo "::add-path::${GITHUB_WORKSPACE}/_flutter/bin"
- name: Install - name: Install
run: | run: |
@@ -842,10 +853,9 @@ jobs:
### ⭐️ Elm ### ⭐️ Elm
An exapmle workflow for [Elm] with [justgook/setup-elm]. An exapmle workflow for [Elm].
[Elm]: https://elm-lang.org [Elm]: https://elm-lang.org
[justgook/setup-elm]: https://github.com/justgook/setup-elm
```yaml ```yaml
name: github pages name: github pages
@@ -861,8 +871,13 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Setup Elm - name: Setup Elm
uses: justgook/setup-elm@v1 run: npm install elm --global
- name: Make - name: Make
run: elm make --optimize src/Main.elm run: elm make --optimize src/Main.elm
@@ -881,6 +896,76 @@ jobs:
publish_dir: ./public publish_dir: ./public
``` ```
### ⭐️ github/personal-website
- [github/personal-website](https://github.com/github/personal-website) - Code that'll help you kickstart a personal website that showcases your work as a software developer.
```yaml
# .github/workflows/github-pages.yml
name: GitHub Pages
on:
push:
branches:
- master
schedule:
- cron: '24 */24 * * *' # Once a day
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./
allow_empty_commit: true
enable_jekyll: true
cname: github.peaceiris.com
```
### ⭐️ Swift Publish
An example workflow for [JohnSundell/Publish].
[JohnSundell/Publish]: https://github.com/JohnSundell/Publish
```yaml
name: GitHub Pages
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Setup JohnSundell/Publish
run: |
cd ${HOME}
git clone --depth=1 https://github.com/JohnSundell/Publish.git
cd ./Publish
swift build -c release
echo "::add-path::${HOME}/Publish/.build/release"
- run: publish-cli generate
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./Output
```
## License ## License
- [MIT License - peaceiris/actions-gh-pages] - [MIT License - peaceiris/actions-gh-pages]
@@ -892,6 +977,7 @@ jobs:
## Maintainer ## Maintainer
- [peaceiris homepage](https://peaceiris.com/) - [peaceiris homepage](https://peaceiris.com/)
- [GitHub Action Hero: Shohei Ueda - The GitHub Blog](https://github.blog/2020-03-22-github-action-hero-shohei-ueda/)

View File

@@ -5,7 +5,8 @@ import {
getWorkDirName, getWorkDirName,
createWorkDir, createWorkDir,
addNoJekyll, addNoJekyll,
addCNAME addCNAME,
skipOnFork
} from '../src/utils'; } from '../src/utils';
beforeEach(() => { beforeEach(() => {
@@ -203,3 +204,30 @@ describe('addCNAME()', () => {
fs.unlinkSync(filepath); fs.unlinkSync(filepath);
}); });
}); });
describe('skipOnFork()', () => {
test('return false on upstream', async () => {
const test = await skipOnFork(false, 'token', '', '');
expect(test).toBeFalsy();
});
test('return false on fork with github_token', async () => {
const test = await skipOnFork(true, 'token', '', '');
expect(test).toBeFalsy();
});
test('return false on fork with deploy_key', async () => {
const test = await skipOnFork(true, '', 'deploy_key', '');
expect(test).toBeFalsy();
});
test('return false on fork with personal_token', async () => {
const test = await skipOnFork(true, '', '', 'personal_token');
expect(test).toBeFalsy();
});
test('return true on fork with no tokens', async () => {
const test = await skipOnFork(true, '', '', '');
expect(test).toBeTruthy();
});
});

26944
lib/index.js

File diff suppressed because one or more lines are too long

2657
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +1,18 @@
{ {
"name": "actions-github-pages", "name": "actions-github-pages",
"version": "3.5.2", "version": "3.5.7",
"description": "GitHub Actions for GitHub Pages", "description": "GitHub Actions for GitHub Pages",
"main": "lib/index.js", "main": "lib/index.js",
"engines": { "engines": {
"node": ">=12.16.1", "node": ">=12.16.2",
"npm": ">=6.14.2" "npm": ">=6.14.4"
}, },
"scripts": { "scripts": {
"all": "npm run format && npm run lint && npm test",
"lint": "eslint ./{src,__tests__}/**/*.ts", "lint": "eslint ./{src,__tests__}/**/*.ts",
"lint:fix": "eslint --fix ./{src,__tests__}/**/*.ts", "lint:fix": "eslint --fix ./{src,__tests__}/**/*.ts",
"test": "jest --coverage --verbose --detectOpenHandles", "test": "jest --coverage --verbose --detectOpenHandles",
"build": "ncc build ./src/index.ts -o lib", "build": "ncc build ./src/index.ts -o lib --minify",
"tsc": "tsc", "tsc": "tsc",
"format": "prettier --write **/*.ts", "format": "prettier --write **/*.ts",
"format:check": "prettier --check **/*.ts", "format:check": "prettier --check **/*.ts",
@@ -56,22 +57,22 @@
"@actions/io": "^1.0.2" "@actions/io": "^1.0.2"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^25.1.4", "@types/jest": "^25.2.1",
"@types/js-yaml": "^3.12.2", "@types/js-yaml": "^3.12.3",
"@types/node": "~12", "@types/node": "~12",
"@typescript-eslint/eslint-plugin": "^2.23.0", "@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.23.0", "@typescript-eslint/parser": "^2.28.0",
"@zeit/ncc": "^0.21.1", "@zeit/ncc": "^0.22.1",
"eslint": "^6.8.0", "eslint": "^6.8.0",
"eslint-plugin-jest": "^23.8.2", "eslint-plugin-jest": "^23.8.2",
"husky": "^4.2.3", "husky": "^4.2.5",
"jest": "^25.1.0", "jest": "^25.3.0",
"jest-circus": "^25.1.0", "jest-circus": "^25.3.0",
"js-yaml": "^3.13.1", "js-yaml": "^3.13.1",
"lint-staged": "^10.0.8", "lint-staged": "^10.1.3",
"prettier": "1.19.1", "prettier": "2.0.4",
"standard-version": "^7.1.0", "standard-version": "^7.1.0",
"ts-jest": "^25.2.1", "ts-jest": "^25.3.1",
"typescript": "^3.8.3" "typescript": "^3.8.3"
} }
} }

View File

@@ -1,18 +1,42 @@
import {context} from '@actions/github';
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 {Inputs} from './interfaces'; import {Inputs} from './interfaces';
import {showInputs, getInputs} from './get-inputs'; import {showInputs, getInputs} from './get-inputs';
import {setTokens} from './set-tokens'; import {setTokens} from './set-tokens';
import {setRepo, setCommitAuthor, commit, push, pushTag} from './git-utils'; import {setRepo, setCommitAuthor, commit, push, pushTag} from './git-utils';
import {getWorkDirName, addNoJekyll, addCNAME} from './utils'; import {getWorkDirName, addNoJekyll, addCNAME, skipOnFork} from './utils';
export async function run(): Promise<void> { export async function run(): Promise<void> {
try { try {
const inps: Inputs = getInputs(); const inps: Inputs = getInputs();
showInputs(inps); showInputs(inps);
if (core.isDebug()) {
console.log(context);
}
const eventName = context.eventName;
if (eventName === 'pull_request' || eventName === 'push') {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const isForkRepository = (context.payload as any).repository.fork;
const isSkipOnFork = await skipOnFork(
isForkRepository,
inps.GithubToken,
inps.DeployKey,
inps.PersonalToken
);
if (isSkipOnFork) {
core.warning(
'This action runs on a fork and not found auth token, Skip deployment'
);
core.setOutput('skip', 'true');
return;
}
}
const remoteURL = await setTokens(inps); const remoteURL = await setTokens(inps);
core.debug(`[INFO] remoteURL: ${remoteURL}`); core.debug(`remoteURL: ${remoteURL}`);
const date = new Date(); const date = new Date();
const unixTime = date.getTime(); const unixTime = date.getTime();

View File

@@ -62,3 +62,18 @@ export async function addCNAME(
fs.writeFileSync(filepath, content + '\n'); fs.writeFileSync(filepath, content + '\n');
core.info(`[INFO] Created ${filepath}`); core.info(`[INFO] Created ${filepath}`);
} }
export async function skipOnFork(
isForkRepository: boolean,
githubToken: string,
deployKey: string,
personalToken: string
): Promise<boolean> {
if (isForkRepository) {
if (githubToken === '' && deployKey === '' && personalToken === '') {
return true;
}
}
return false;
}