Skip to content

Commit 380b190

Browse files
authored
fix: avoid #29 for keepFiles option (#34)
* fix: avoid #29 * docs: update TOC * docs: update tag to v2.4.0
1 parent 8eedda6 commit 380b190

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Table of Contents
2828
- [⭐️ `PERSONAL_TOKEN`](#%EF%B8%8F-personal_token)
2929
- [⭐️ `GITHUB_TOKEN`](#%EF%B8%8F-github_token)
3030
- [⭐️ Suppressing empty commits](#%EF%B8%8F-suppressing-empty-commits)
31+
- [⭐️ Keeping existing files](#%EF%B8%8F-keeping-existing-files)
3132
- [Tips and FAQ](#tips-and-faq)
3233
- [How to add `CNAME`](#how-to-add-cname)
3334
- [Deployment completed but you cannot read](#deployment-completed-but-you-cannot-read)
@@ -108,7 +109,7 @@ jobs:
108109
run: hugo --gc --minify --cleanDestinationDir
109110

110111
- name: Deploy
111-
uses: peaceiris/actions-gh-pages@v2.3.2
112+
uses: peaceiris/actions-gh-pages@v2.4.0
112113
env:
113114
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
114115
PUBLISH_BRANCH: gh-pages
@@ -152,8 +153,8 @@ You can pull a public docker image from Docker Hub.
152153
By pulling docker images, you can reduce the overall execution time of your workflow. In addition, `latest` tag is provided.
153154

154155
```diff
155-
- uses: peaceiris/actions-gh-pages@v2.3.2
156-
+ uses: docker://peaceiris/gh-pages:v2.3.2
156+
- uses: peaceiris/actions-gh-pages@v2.4.0
157+
+ uses: docker://peaceiris/gh-pages:v2.4.0
157158
```
158159

159160
- [peaceiris/gh-pages - Docker Hub](https://hub.docker.com/r/peaceiris/gh-pages)
@@ -189,8 +190,8 @@ By default, a commit will always be generated and pushed to the `PUBLISH_BRANCH`
189190
For example:
190191

191192
```yaml
192-
- name: deploy
193-
uses: peaceiris/actions-gh-pages@v2.3.2
193+
- name: Deploy
194+
uses: peaceiris/actions-gh-pages@v2.4.0
194195
env:
195196
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
196197
PUBLISH_BRANCH: gh-pages
@@ -206,8 +207,8 @@ By default, existing files in the publish branch are removed before adding the o
206207
For example:
207208

208209
```yaml
209-
- name: deploy
210-
uses: peaceiris/actions-gh-pages@v2.3.2
210+
- name: Deploy
211+
uses: peaceiris/actions-gh-pages@v2.4.0
211212
env:
212213
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
213214
PUBLISH_BRANCH: gh-pages
@@ -217,6 +218,7 @@ For example:
217218
```
218219

219220

221+
220222
## Tips and FAQ
221223

222224
### How to add `CNAME`
@@ -279,7 +281,7 @@ jobs:
279281
npm run build
280282
281283
- name: deploy
282-
uses: peaceiris/actions-gh-pages@v2.3.2
284+
uses: peaceiris/actions-gh-pages@v2.4.0
283285
env:
284286
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
285287
PUBLISH_BRANCH: gh-pages
@@ -327,7 +329,7 @@ jobs:
327329
run: npm run build
328330
329331
- name: deploy
330-
uses: peaceiris/actions-gh-pages@v2.3.2
332+
uses: peaceiris/actions-gh-pages@v2.4.0
331333
env:
332334
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
333335
PUBLISH_BRANCH: gh-pages
@@ -377,7 +379,7 @@ jobs:
377379
run: touch ./out/.nojekyll
378380
379381
- name: deploy
380-
uses: peaceiris/actions-gh-pages@v2.3.2
382+
uses: peaceiris/actions-gh-pages@v2.4.0
381383
env:
382384
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
383385
PUBLISH_BRANCH: gh-pages
@@ -424,7 +426,7 @@ jobs:
424426
run: npm run generate
425427
426428
- name: deploy
427-
uses: peaceiris/actions-gh-pages@v2.3.2
429+
uses: peaceiris/actions-gh-pages@v2.4.0
428430
env:
429431
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
430432
PUBLISH_BRANCH: gh-pages
@@ -472,7 +474,7 @@ jobs:
472474
run: mkdocs build
473475
474476
- name: Deploy
475-
uses: peaceiris/actions-gh-pages@v2.3.2
477+
uses: peaceiris/actions-gh-pages@v2.4.0
476478
env:
477479
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
478480
PUBLISH_BRANCH: gh-pages

entrypoint.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ local_dir="${HOME}/$(tr -cd 'a-f0-9' < /dev/urandom | head -c 32)"
6262
if git clone --depth=1 --single-branch --branch "${remote_branch}" "${remote_repo}" "${local_dir}"; then
6363
cd "${local_dir}"
6464

65-
print_info "Keeping existing files: ${INPUT_KEEPFILES}"
66-
if [[ ${INPUT_KEEPFILES} != "true" ]]; then
65+
if [[ ${INPUT_KEEPFILES} == "true" ]]; then
66+
print_info "Keeping existing files: ${INPUT_KEEPFILES}"
67+
else
6768
git rm -r --ignore-unmatch '*'
6869
fi
6970

0 commit comments

Comments
 (0)