Skip to content

Commit 7f050b9

Browse files
authored
Create main.yml
1 parent 8758aff commit 7f050b9

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# workflow的名字
2+
name: change
3+
4+
# 當以下事件發生時,觸發
5+
on:
6+
# 這邊設定的是:push/pullrequest到main時即觸發
7+
push:
8+
branches:
9+
- main
10+
11+
# 有加這行可以手動觸發actions
12+
workflow_dispatch:
13+
14+
# 觸發內容
15+
jobs:
16+
# 這個workflow有個job叫做build
17+
build:
18+
# 這個job要run在ubuntu上
19+
runs-on: ubuntu-latest
20+
21+
# job的步驟要做些什麼咧
22+
steps:
23+
# 1. 專門for node.js的actions,記得依node.js版本更新其後version
24+
- uses: actions/checkout@v4
25+
# 把vue內容build起來
26+
- name: Install & Build # 執行
27+
run: |
28+
npm install
29+
npm run build
30+
31+
# 2. deploy
32+
- name: Deploy
33+
# 別人的actions拿來借用
34+
uses: JamesIves/github-pages-deploy-action@releases/v4
35+
with:
36+
BRANCH: deploy # deploy 到 gh-pages 這個分支
37+
FOLDER: dist # build 後的資料夾

0 commit comments

Comments
 (0)