diff --git a/.gitignore b/.gitignore index 5d947ca..2e81b75 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/README.md b/README.md index 77d692b..d2e5570 100644 --- a/README.md +++ b/README.md @@ -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`[1](#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` |
@@ -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: | diff --git a/action.yml b/action.yml index 2e911ba..ced98cf 100644 --- a/action.yml +++ b/action.yml @@ -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 @@ -30,5 +34,5 @@ runs: - ${{ inputs.deploy_key }} - ${{ inputs.commit_msg }} branding: - icon: 'package' - color: 'blue' \ No newline at end of file + icon: 'package' + color: 'blue' diff --git a/entrypoint.sh b/entrypoint.sh index e5b7812..fed351d 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -22,7 +22,10 @@ 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 @@ -30,14 +33,20 @@ then 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." \ No newline at end of file +echo ::set-output name=notify::"Deploy complate."