Skip to content

Commit a63b088

Browse files
committed
Croe: add CHAME paramerter
1 parent 78ea793 commit a63b088

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ The action will auto deploy the vuepress project when you push your code. Enjoy!
3737
| :------------ | :------------ |:------------ |:------------ |
3838
| `ACCESS_TOKEN` | Personal access token | `secrets` | **Yes** |
3939
| `TARGET_REPO` | The repository you want to deploy. e.g.:`jenkey2011/blog`. Default: **current repository** | `env` | **No** |
40-
| `TARGET_REPO` | The branch you want to deploy. e.g.:`github-pages`.Default: **github-pages** | `env` | **No** |
40+
| `TARGET_REPO` | The branch you want to deploy. e.g.:`gh-pages`.Default: **gh-pages** | `env` | **No** |
4141
| `BUILD_SCRIPT` | The script to build the vuepress project. e.g.: `yarn && yarn build` | `env` | **Yes** |
4242
| `BUILD_DIR` | The output of the build-script above. e.g.: `blog/.vuepress/dist/` | `env` | **Yes** |
43+
| `CNAME` | Alias Record of your site. | `env` | **no** |
4344

4445

4546
## Step-by-Step Guide

README.zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
| :------------ | :------------ |:------------ |:------------ |
3838
| `ACCESS_TOKEN` | github的token | `secrets` | **是** |
3939
| `TARGET_REPO` | 目标仓库,例: `jenkey2011/blog`。**默认当前仓库** | `env` | **否** |
40-
| `TARGET_REPO` | 目标仓库的分支,例:`github-pages`。**默认 github-pages**| `env` | **否** |
40+
| `TARGET_REPO` | 目标仓库的分支,例:`gh-pages`。**默认 gh-pages**| `env` | **否** |
4141
| `BUILD_SCRIPT` | 构建脚本 例: `yarn && yarn build` | `env` | **是** |
4242
| `BUILD_DIR` | 构建产物的目录 e.g.: `blog/.vuepress/dist/` | `env` | **是** |
43-
43+
| `CNAME` | Github Pages 站点别名 | `env` | **no** |
4444
## 详细教程
4545

4646
### 创建token

entrypoint.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ echo "Build success"
1313
echo "==> Changing directory to '$BUILD_DIR' ..."
1414
cd $BUILD_DIR
1515

16-
echo "#################################################"
17-
echo "Now deploying to GitHub Pages..."
18-
1916
# Get respository
2017
if [[ -z "$TARGET_REPO" ]]; then
2118
REPOSITORY_NAME="${GITHUB_REPOSITORY}"
@@ -45,6 +42,12 @@ if [ -z "$(git status --porcelain)" ]; then
4542
exit 0
4643
fi
4744

45+
# Generate a CNAME file
46+
if [ ! -z "$CNAME" ]; then
47+
echo "Generating a CNAME file..."
48+
echo $CNAME > CNAME
49+
fi
50+
4851
echo "==> Starting deploying"
4952

5053
git add .

0 commit comments

Comments
 (0)