Skip to content

Commit

Permalink
Merge pull request #12 from jenkey2011/dev
Browse files Browse the repository at this point in the history
feat: support custom commit message~
  • Loading branch information
jenkey2011 authored Dec 15, 2020
2 parents d6258ef + e7b75bf commit 7ad178a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
TARGET_BRANCH: master
BUILD_SCRIPT: yarn && yarn build
BUILD_DIR: blog/.vuepress/dist/
COMMIT_MESSAGE: 'Auto deploy from Github Actions'
```
The action will auto deploy the vuepress project when you push your code. Enjoy!!!
Expand Down Expand Up @@ -69,7 +70,8 @@ There are three situations. Each situation corresponds to a deployment file.
| `TARGET_LINK` | The full address of the target repo will cover `TARGET_REPO` for other platforms. e.g.:`https://user:${{ secrets.CODING_TOKEN }}@team.coding.net/team/repo.git`. | `env` | **No** |
| `BUILD_SCRIPT` | The script to build the vuepress project. e.g.: `yarn && yarn build` | `env` | **Yes** |
| `BUILD_DIR` | The output of the build-script above. e.g.: `blog/.vuepress/dist/` | `env` | **Yes** |
| `CNAME` | Alias Record of your site. | `env` | **no** |
| `COMMIT_MESSAGE` | The commit message supplied when pushing new changes e.g.: `Auto deploy from Github Actions` | `env` | **No** |
| `CNAME` | Alias Record of your site. | `env` | **No** |


## Step-by-Step Guide
Expand Down
5 changes: 3 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ jobs:
| `TARGET_BRANCH` | 目标仓库的分支,例:`gh-pages`。**默认 gh-pages**| `env` | **否** |
| `TARGET_LINK` | 目标仓库的完整链接,会覆盖目标仓库,用于其他平台,例:`https://user:${{ secrets.CODING_TOKEN }}@team.coding.net/team/repo.git`| `env` | **否** |
| `BUILD_SCRIPT` | 构建脚本 例: `yarn && yarn build` | `env` | **是** |
| `BUILD_DIR` | 构建产物的目录 e.g.: `blog/.vuepress/dist/` | `env` | **是** |
| `CNAME` | Github Pages 站点别名 | `env` | **no** |
| `BUILD_DIR` | 构建产物的目录 例: `blog/.vuepress/dist/` | `env` | **是** |
| `COMMIT_MESSAGE` | 自动部署时的提交信息 例: `Auto deploy from Github Actions` | `env` | **否** |
| `CNAME` | Github Pages 站点别名 | `env` | **否** |
## 详细教程

### 创建token
Expand Down
7 changes: 6 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ fi

echo "==> Starting deploying"

# Final repository
if [[ -z "$COMMIT_MESSAGE" ]]; then
COMMIT_MESSAGE="Auto deploy from Github Actions"
fi

git add .
git commit -m 'Auto deploy from Github Actions'
git commit -m "$COMMIT_MESSAGE"
git push --force $DEPLOY_REPO master:$DEPLOY_BRAN
rm -fr .git

Expand Down

0 comments on commit 7ad178a

Please sign in to comment.