vuepress-theme-vdoing/.github/workflows/ci.yml

34 lines
1.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: CI
#on: [push]
# 在master分支发生push事件时触发。
on:
push:
branches:
- master
jobs: # 工作流
build: # 自定义名称
runs-on: ubuntu-latest #运行在虚拟机环境ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps: # 步骤
- name: Checkout # 步骤1
uses: actions/checkout@v1 # 使用的动作。格式userName/repoName。作用检出仓库获取源码。 官方actions库https://github.com/actions
- name: Use Node.js ${{ matrix.node-version }} # 步骤2
uses: actions/setup-node@v1 # 作用安装nodejs
with:
node-version: ${{ matrix.node-version }} # 版本
- name: Build and Deploy # 步骤3
uses: JamesIves/github-pages-deploy-action@master # 作用将项目构建和部署到github。 https://github.com/JamesIves/github-pages-deploy-action
env: # 设置环境变量
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # toKen私密变量
CODING_TOKEN: ${{ secrets.CODING_TOKEN }} # 腾讯云开发者平台coding私密token
BASE_BRANCH: master # 要部署的文件夹所在的分支.
BRANCH: gh-pages # 部署到的分支
FOLDER: docs/.vuepress/dist # 要部署的文件夹.
BUILD_SCRIPT: npm install && npm run build && npm run deployToCoding && cd docs/.vuepress/dist && echo 'b.evanblogweb.com' > CNAME && cd - # 部署前要执行的命令,记得进入某个目录后要后面要退回开始的目录
# npm run deployToCoding 此命令是部署到腾讯云开发者平台coding