-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (114 loc) · 3.41 KB
/
deployexample.yaml
File metadata and controls
120 lines (114 loc) · 3.41 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Deploy React Vite and Vue Examples and TypeScript to GitHub Pages
on:
push:
branches: [ main ]
jobs:
build-react:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: yarn
working-directory: ./examples/vite+react
- name: Build React App
run: yarn build
working-directory: ./examples/vite+react
- name: Upload React Build Artifacts
uses: actions/upload-artifact@v4
with:
name: react-build
path: ./examples/vite+react/build
build-vue:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm ci
working-directory: ./examples/vue
- name: Build Vue App
run: npm run build
working-directory: ./examples/vue
- name: Upload Vue Build Artifacts
uses: actions/upload-artifact@v4
with:
name: vue-build
path: ./examples/vue/build
build-typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm ci
working-directory: ./examples/typescript
- name: Build TypeScript App
run: npm run build
working-directory: ./examples/typescript
- name: Upload TypeScript Build Artifacts
uses: actions/upload-artifact@v4
with:
name: typescript-build
path: ./examples/typescript/build
generate-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install build tools
run: npm i -g pnpm
- name: Install dependencies
run: pnpm i
- name: Run tests with coverage
run: pnpm test:coverage
- name: Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: ./coverage
deploy:
runs-on: ubuntu-latest
needs: [build-react, build-vue, build-typescript,generate-coverage]
steps:
- uses: actions/checkout@v3
- name: Download React Build Artifacts
uses: actions/download-artifact@v4
with:
name: react-build
path: ./public
- name: Download Vue Build Artifacts
uses: actions/download-artifact@v4
with:
name: vue-build
path: ./public
- name: Download TypeScript Build Artifacts
uses: actions/download-artifact@v4
with:
name: typescript-build
path: ./public
- name: Copy index.html to public directory
run: cp ./examples/index.html ./public/index.html
- name: Download Coverage Report
uses: actions/download-artifact@v4
with:
name: coverage-report
path: ./public/coverage
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./public
allow_empty_commit: true