Skip to content

Commit 7fae62b

Browse files
authored
Merge pull request #32 from thingraph/feature/upgrade
Feature/upgrade
2 parents 2e77d0e + 4aa8168 commit 7fae62b

File tree

2 files changed

+68
-1
lines changed

2 files changed

+68
-1
lines changed

.github/workflows/workflow.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# .github/workflows/auto-deploy.yml
2+
3+
name: auto deploy 🚀
4+
5+
on:
6+
# 监听push操作
7+
push:
8+
branches:
9+
- main # 这里只配置了main分支,所以只有推送main分支才会触发以下任务
10+
pull_request:
11+
12+
# 这个选项可以使你手动在 Action tab 页面触发工作流
13+
# workflow_dispatch:
14+
15+
permissions:
16+
# 允许对仓库的内容进行写操作。包括创建、修改和删除文件、目录以及提交更改等
17+
# 这里只配置了push,所以只有推送main分支才会触发以下任务
18+
contents: write
19+
# 允许管理 GitHub Pages 服务并对其进行写操作
20+
pages: write
21+
22+
23+
jobs:
24+
# 任务ID
25+
build-and-deploy:
26+
# 运行环境
27+
# runs-on: macos-latest
28+
# runs-on: windows-latest
29+
runs-on: ubuntu-latest
30+
concurrency:
31+
group: ${{ github.workflow }}-${{ github.ref }}
32+
33+
# 步骤
34+
steps:
35+
# 官方action,将代码拉取到虚拟机
36+
- name: Checkout
37+
uses: actions/checkout@v3
38+
39+
# 建一个名为setup-node的步骤(安装指定版本的Node.js)
40+
- name: setup-node
41+
# 使用setup-node@v3这个action
42+
uses: actions/setup-node@v3
43+
# 指定某个action 可能需要输入的参数
44+
with:
45+
node-version: '20'
46+
47+
# 安装 pnpm
48+
- name: Install pnpm
49+
run: npm install pnpm -g
50+
51+
# 安装依赖
52+
- name: Install dependencies
53+
run: pnpm i
54+
# 打包
55+
- name: Build application 🔧
56+
run: pnpm run build
57+
58+
# 部署 https://github.com/JamesIves/github-pages-deploy-action
59+
- name: Deploy 🚀
60+
uses: JamesIves/github-pages-deploy-action@v4
61+
if: github.ref == 'refs/heads/main'
62+
with:
63+
token: ${{ secrets.GITHUB_TOKEN }}
64+
branch: gh-pages # default: gh-pages
65+
folder: dist
66+
clean: true # Automatically remove deleted files from the deploy branch
67+
# commit-message: ${{ github.event.head_commit.message }} # default: `Deploying to gh-pages from @ 3238feb 🚀`
68+
# commit-message: "deploy: ${{ github.sha }} (${{ github.event.head_commit.message }}) 🚀 "

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
"eslint-plugin-promise": "^4.2.1",
8080
"eslint-plugin-standard": "^4.0.0",
8181
"eslint-plugin-vue": "^7.17.0",
82-
"node-sass": "^7.0.1",
8382
"sass": "^1.54.5",
8483
"sass-loader": "^8.0.2",
8584
"typescript": "~3.9.3",

0 commit comments

Comments
 (0)