forked from Jiacheng-z/FFXIV-Monitor-Tools
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (32 loc) · 1.31 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Build GitHub Pages
on:
# 手动运行工作流程(workflow_dispatch 事件触发器配置后可以在actions下手动运行工作流)
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest #指定服务器的运行环境:最新版本ubuntu
steps:
# 使用actions/checkout@v4 库拉取代码到 ubuntu 上
- name: Checkout
uses: actions/checkout@v4
with:
# 根据网上资料查询此处可以设置为 false。https://github.com/actions/checkout
persist-credentials: false
# 设置node的版本
- name: Use Node.js
# 使用 actions/setup-node@v3 库安装 nodejs,with 提供了一个参数 node-version 表示要安装的 nodejs 版本
uses: actions/setup-node@v3
with:
node-version: '20.x'
cache: 'npm'
# 打包成静态文件
- name: Build
run: npm install && npm run build
# 部署到GitHub Pages - 也就是将打包内容发布到GitHub Pages
- name: Deploy
# 使用别人写好的 actions去部署(将打包文件部署到指定分支上)
uses: JamesIves/github-pages-deploy-action@v4
# 自定义环境变量
with:
# 填写打包好的目录名称路径,本项目配置在根目录
folder: dist