diff --git a/.github/workflows/nodejs.yml b/.github/workflows/ci.yml similarity index 98% rename from .github/workflows/nodejs.yml rename to .github/workflows/ci.yml index 6d87478..c721cdf 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Node CI +name: CI on: [push] # 在master分支发生push事件时触发。 diff --git a/README.MD b/README.MD index e66531c..7dfe9ef 100644 --- a/README.MD +++ b/README.MD @@ -77,23 +77,20 @@ yarn built #### 3、使github pages与域名关联 -进入github pages设置,在`Custom domain`中填入域名`evanblogweb.com`,Save保存。这时你会在gh-pages分支中看到新增了一个`CNAME`文件,内容为刚刚填入的域名。到这,你就可以通过域名愉快的访问博客啦 - - - -#### 4、提交代码会自动删除`CNAME`文件的问题(有问题待修改) - -```bash -echo 'www.evanblogweb.com' > CNAME # 新建CNAME文件,并输入内容为域名 - -# 一顿git操作提交到博客仓库的deployment分支 -git init -git add -A -git commit -m 'create CNAME' -git push -f git@github.com:/.git master:deployment +在pageage.json文件scripts中添加如下脚本 +```js +"chame:gitpage": "cd docs/.vuepress/dist && echo 'www.evanblogweb.com' > CNAME" +// 域名替换成你的 ``` +在自动部署配置文件ci.yml中jobs.build.steps..env.BUILD_SCRIPT添加脚本 + +```sh +npm run chame:gitpage +``` + +