-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (31 loc) · 1007 Bytes
/
vue.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
38
39
name: Build and Deploy Vue.js to gh-pages
on:
push:
branches: [ "main" ] # 當main分支有推送時觸發
workflow_dispatch: # 允許手動觸發
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write # 需要寫入權限來推送到gh-pages分支
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Copy CNAME file
run: echo 'k12edu.us.kg' > ./dist/CNAME # 定義的網域名稱
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist # Vue.js 默認的建置輸出目錄
publish_branch: gh-pages