Skip to content

Commit 57b4d4a

Browse files
authored
ci: add deploy-github (#193)
1 parent 061fd5e commit 57b4d4a

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Deploy to github.io
2+
3+
on:
4+
push:
5+
branches: [ dev, main ] # 设置源码主分支
6+
workflow_dispatch: {} # 支持手动触发
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
- name: Setup pnpm
24+
uses: pnpm/action-setup@v3
25+
with:
26+
version: 9
27+
- name: Install deps
28+
run: pnpm -F tiny-pro-vue i
29+
- name: Build site
30+
run: pnpm -F tiny-pro-vue build
31+
env:
32+
VITE_BASE: /tiny-pro/
33+
- name: Setup Pages
34+
uses: actions/configure-pages@v2
35+
- name: Build with Jekyll
36+
uses: actions/jekyll-build-pages@v1
37+
with:
38+
source: ./template/tinyvue/dist
39+
destination: ./_site
40+
- name: Upload artifact
41+
uses: actions/upload-pages-artifact@v3
42+
# Deployment job
43+
deploy:
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
runs-on: ubuntu-latest
48+
needs: build
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)