Skip to content

Commit

Permalink
Croe: add CHAME paramerter
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkey2011 committed Feb 12, 2020
1 parent 78ea793 commit a63b088
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ The action will auto deploy the vuepress project when you push your code. Enjoy!
| :------------ | :------------ |:------------ |:------------ |
| `ACCESS_TOKEN` | Personal access token | `secrets` | **Yes** |
| `TARGET_REPO` | The repository you want to deploy. e.g.:`jenkey2011/blog`. Default: **current repository** | `env` | **No** |
| `TARGET_REPO` | The branch you want to deploy. e.g.:`github-pages`.Default: **github-pages** | `env` | **No** |
| `TARGET_REPO` | The branch you want to deploy. e.g.:`gh-pages`.Default: **gh-pages** | `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** |


## Step-by-Step Guide
Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
| :------------ | :------------ |:------------ |:------------ |
| `ACCESS_TOKEN` | github的token | `secrets` | **是** |
| `TARGET_REPO` | 目标仓库,例: `jenkey2011/blog`。**默认当前仓库** | `env` | **否** |
| `TARGET_REPO` | 目标仓库的分支,例:`github-pages`。**默认 github-pages**| `env` | **否** |
| `TARGET_REPO` | 目标仓库的分支,例:`gh-pages`。**默认 gh-pages**| `env` | **否** |
| `BUILD_SCRIPT` | 构建脚本 例: `yarn && yarn build` | `env` | **是** |
| `BUILD_DIR` | 构建产物的目录 e.g.: `blog/.vuepress/dist/` | `env` | **是** |

| `CNAME` | Github Pages 站点别名 | `env` | **no** |
## 详细教程

### 创建token
Expand Down
9 changes: 6 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ echo "Build success"
echo "==> Changing directory to '$BUILD_DIR' ..."
cd $BUILD_DIR

echo "#################################################"
echo "Now deploying to GitHub Pages..."

# Get respository
if [[ -z "$TARGET_REPO" ]]; then
REPOSITORY_NAME="${GITHUB_REPOSITORY}"
Expand Down Expand Up @@ -45,6 +42,12 @@ if [ -z "$(git status --porcelain)" ]; then
exit 0
fi

# Generate a CNAME file
if [ ! -z "$CNAME" ]; then
echo "Generating a CNAME file..."
echo $CNAME > CNAME
fi

echo "==> Starting deploying"

git add .
Expand Down

0 comments on commit a63b088

Please sign in to comment.