Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "github actions build and deploy gh-pages" #流程名称
on: pull #当对当前仓库pull代码的时候触发
jobs:
build-and-deploy: #脚本名称
runs-on: ubuntu-latest #运行在乌班图linux上
steps:
- name: Checkout #步骤1:checkout
uses: actions/checkout@v2.3.1 #checkout需要引用的依赖
with:
persist-credentials: false #checkout依赖参数:不保存证书
- name: install and build #步骤2:安装依赖和打包
run: | #运行下面两行命令
npm install #安装依赖,当前分支的根目录做为默认目录
npm run build #打包代码

- name: Install SSH Client #步骤3:关联ssh私钥
uses: webfactory/ssh-agent@v0.2.0 #这里调用这个第三方的库,可以直接关联ssh私钥
with: #下面是参数
#这里需要通过github的环境参数中获取私钥,并传给这个库,(这是最安全的,git当然不能让用户直接输入私钥内容)
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- name: Deploy #步骤4:把编译好的静态目录上传到gh-pages分支上
uses: JamesIves/github-pages-deploy-action@3.5.9 #这里调用第三方依赖,用于上传代码到指定分支上
with:
SSH: true #是否通过ssh方式
BRANCH: gh-pages #github pages 默认的分支
FOLDER: dist #上传文件的目录,我这个目录在根目录下,如果是子目录可以这么写 docs/.vuepress/dist
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "github actions build and deploy gh-pages" #流程名称
on: pull #当对当前仓库pull代码的时候触发
jobs:
build-and-deploy: #脚本名称
runs-on: ubuntu-latest #运行在乌班图linux上
steps:
- name: Checkout #步骤1:checkout
uses: actions/checkout@v2.3.1 #checkout需要引用的依赖
with:
persist-credentials: false #checkout依赖参数:不保存证书
- name: install and build #步骤2:安装依赖和打包
run: | #运行下面两行命令
npm install #安装依赖,当前分支的根目录做为默认目录
npm run build #打包代码

- name: Install SSH Client #步骤3:关联ssh私钥
uses: webfactory/ssh-agent@v0.2.0 #这里调用这个第三方的库,可以直接关联ssh私钥
with: #下面是参数
#这里需要通过github的环境参数中获取私钥,并传给这个库,(这是最安全的,git当然不能让用户直接输入私钥内容)
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- name: Deploy #步骤4:把编译好的静态目录上传到gh-pages分支上
uses: JamesIves/github-pages-deploy-action@3.5.9 #这里调用第三方依赖,用于上传代码到指定分支上
with:
SSH: true #是否通过ssh方式
BRANCH: gh-pages #github pages 默认的分支
FOLDER: dist #上传文件的目录,我这个目录在根目录下,如果是子目录可以这么写 docs/.vuepress/dist
27 changes: 27 additions & 0 deletions .github/workflows/flows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "github actions build and deploy gh-pages" #流程名称
on: pull #当对当前仓库push代码的时候触发
jobs:
build-and-deploy: #脚本名称
runs-on: ubuntu-latest #运行在乌班图linux上
steps:
- name: Checkout #步骤1:checkout
uses: actions/checkout@v2.3.1 #checkout需要引用的依赖
with:
persist-credentials: false #checkout依赖参数:不保存证书
- name: install and build #步骤2:安装依赖和打包
run: | #运行下面两行命令
npm install #安装依赖,当前分支的根目录做为默认目录
npm run build #打包代码

- name: Install SSH Client #步骤3:关联ssh私钥
uses: webfactory/ssh-agent@v0.2.0 #这里调用这个第三方的库,可以直接关联ssh私钥
with: #下面是参数
#这里需要通过github的环境参数中获取私钥,并传给这个库,(这是最安全的,git当然不能让用户直接输入私钥内容)
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- name: Deploy #步骤4:把编译好的静态目录上传到gh-pages分支上
uses: JamesIves/github-pages-deploy-action@3.5.9 #这里调用第三方依赖,用于上传代码到指定分支上
with:
SSH: true #是否通过ssh方式
BRANCH: gh-pages #github pages 默认的分支
FOLDER: dist #上传文件的目录,我这个目录在根目录下,如果是子目录可以这么写 docs/.vuepress/dist