Skip to content

Commit

Permalink
fix: gulp or not
Browse files Browse the repository at this point in the history
  • Loading branch information
woshiwalter committed Mar 26, 2021
1 parent 01c8e94 commit e34a107
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ bin-release/
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.
.idea
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ For more information on these inputs, see the [API Documentation](https://develo
| `user_name` | NO | The user name of your github account for deploying. | `github-actions[bot]` |
| `user_email` | NO | The user email of your github account for deploying. | `41898282+github-actions[bot]@users.noreply.github.com`[<sup>1</sup>](#refer-anchor-1) |
| `deploy_key` | **YES** | The **deploy key** to access your **GitHub Pages repository**. | `null` |
| `gulp` | NO | Run `gulp` command or not, true or false. | `false` |
| `commit_msg` | NO | Git commit messages for your GitHub Pages repository. | `null` |

<div id="refer-anchor-1"></div>
Expand Down Expand Up @@ -93,6 +94,7 @@ jobs:
user_name: your github username # (or delete this input setting to use bot account)
user_email: your github useremail # (or delete this input setting to use bot account)
commit_msg: ${{ github.event.head_commit.message }} # (or delete this input setting to use hexo default settings)
gulp: 'true' # When true to run the gulp command ,and when false will not run the gulp command
# Use the output from the `deploy` step(use for test action)
- name: Get the output
run: |
Expand Down
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ inputs:
description: 'The deploy key for Github Pages repo'
required: true
default: ''
gulp:
description: 'Run gulp command or not. true or false'
required: false
default: 'false'
commit_msg:
description: 'Git commit messages to your GitHub Pages repository.'
required: false
Expand All @@ -30,5 +34,5 @@ runs:
- ${{ inputs.deploy_key }}
- ${{ inputs.commit_msg }}
branding:
icon: 'package'
color: 'blue'
icon: 'package'
color: 'blue'
17 changes: 13 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,31 @@ if [ "$INPUT_COMMIT_MSG" = "none" ]
then
hexo clean
hexo generate
gulp
if [ -n "$INPUT_GULP" ] && [ "$INPUT_GULP" = "true" ]
then
gulp
fi
hexo deploy
elif [ "$INPUT_COMMIT_MSG" = "" ] || [ "$INPUT_COMMIT_MSG" = "default" ]
then
# pull original publish repo
NODE_PATH=$NODE_PATH:$(pwd)/node_modules node /sync_deploy_history.js
hexo clean
hexo generate
gulp
if [ -n "$INPUT_GULP" ] && [ "$INPUT_GULP" = "true" ]
then
gulp
fi
hexo deploy
else
NODE_PATH=$NODE_PATH:$(pwd)/node_modules node /sync_deploy_history.js
hexo clean
hexo generate
gulp
if [ -n "$INPUT_GULP" ] && [ "$INPUT_GULP" = "true" ]
then
gulp
fi
hexo deploy -m "$INPUT_COMMIT_MSG"
fi

echo ::set-output name=notify::"Deploy complate."
echo ::set-output name=notify::"Deploy complate."

0 comments on commit e34a107

Please sign in to comment.