mirror of
https://github.com/talktao/Vue3-Vite-Vant-TS-H5.git
synced 2025-04-06 03:57:55 +08:00
feat: ci
This commit is contained in:
parent
9ec158d609
commit
6907bea52a
59
.github/workflows/ci.yml
vendored
59
.github/workflows/ci.yml
vendored
@ -1,41 +1,26 @@
|
|||||||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
name: vue3-vite-vant-ts-h5
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
on: # 监听 master 分支上的 push 事件
|
||||||
|
|
||||||
name: Node.js CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches:
|
||||||
pull_request:
|
- master
|
||||||
branches: [ "main" ]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest # 构建环境使用 ubuntu
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [12.x, 14.x, 16.x]
|
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
uses: actions/checkout@v2.3.1
|
||||||
uses: actions/setup-node@v3
|
with:
|
||||||
with:
|
persist-credentials: false
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
cache: 'npm'
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm run build --if-present
|
|
||||||
- run: npm test
|
|
||||||
|
|
||||||
deploy:
|
- name: Install and Build # 下载依赖 打包项目
|
||||||
- name: Deploy
|
run: |
|
||||||
uses: JamesIves/github-pages-deploy-action@3.5.9 # 使用别人写好的 actions
|
npm install
|
||||||
with: # 自定义环境变量
|
npm run build
|
||||||
ACCESS_TOKEN: ${{ secrets.VUE3_TOKEN }} # VUE3_TOKEN 是我的 secret 名称,需要替换成你的
|
- name: Deploy
|
||||||
BRANCH: gh-pages
|
uses: JamesIves/github-pages-deploy-action@3.5.9 # 使用别人写好的 actions
|
||||||
FOLDER: dist
|
with: # 自定义环境变量
|
||||||
REPOSITORY_NAME: talktao/talktao.github.io # 这是我的 github page 仓库
|
ACCESS_TOKEN: ${{ secrets.VUE3_TOKEN }} # VUE3_TOKEN 是我的 secret 名称,需要替换成你的
|
||||||
TARGET_FOLDER: vue3-vite-vant-ts-h5 # 打包的文件将放到静态服务器 vue3-vite-vant-ts-h5 目录下
|
BRANCH: gh-pages
|
||||||
|
FOLDER: dist
|
||||||
|
REPOSITORY_NAME: talktao/talktao.github.io # 这是我的 github page 仓库
|
||||||
|
TARGET_FOLDER: vue3-vite-vant-ts-h5 # 打包的文件将放到静态服务器 vue3-vite-vant-ts-h5 目录下
|
||||||
|
Loading…
x
Reference in New Issue
Block a user