-
-
Notifications
You must be signed in to change notification settings - Fork 2
144 lines (128 loc) · 4.09 KB
/
Copy pathdeploy.yml
File metadata and controls
144 lines (128 loc) · 4.09 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install dependencies
run: bun install
- name: Build all packages
run: bun run --filter './packages/*' build
- name: Build all apps
run: |
for app in apps/*; do
if [ "$app" == "apps/mcp-cafe24-admin-example" ]; then continue; fi
if [ -d "$app" ] && [ -f "$app/package.json" ]; then
echo "Building $app..."
bun run --filter "./$app" build
fi
done
- name: Merge all apps to deploy directory
run: |
mkdir -p deploy_dist
for app in apps/*; do
if [ "$app" == "apps/mcp-cafe24-admin-example" ]; then continue; fi
if [ -d "$app" ]; then
(
cd "$app"
if [ -d "out" ]; then
app_dir=$(basename $(pwd))
echo "Copying $app_dir..."
cp -r out "../../deploy_dist/$app_dir"
fi
)
fi
done
- name: Generate index.html
run: |
cat > deploy_dist/index.html << 'EOF'
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>TS Workspace Examples</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
max-width: 800px;
margin: 50px auto;
padding: 0 20px;
}
h1 { color: #333; margin-bottom: 30px; }
.app-list { list-style: none; padding: 0; }
.app-item {
margin: 15px 0;
padding: 20px;
border: 1px solid #e0e0e0;
border-radius: 8px;
transition: all 0.2s;
}
.app-item:hover {
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
transform: translateY(-2px);
}
.app-link {
text-decoration: none;
color: #0366d6;
font-size: 18px;
font-weight: 500;
}
.app-link:hover { text-decoration: underline; }
</style>
</head>
<body>
<h1>📦 TS Workspace Examples</h1>
<ul class="app-list">
EOF
for app in apps/*; do
if [ "$app" == "apps/mcp-cafe24-admin-example" ]; then continue; fi
if [ -d "$app" ] && [ -f "$app/package.json" ]; then
(
cd "$app"
app_name=$(basename $(pwd))
echo " <li class=\"app-item\">" >> ../../deploy_dist/index.html
echo " <a href=\"/pkgs/${app_name}/\" class=\"app-link\">" >> ../../deploy_dist/index.html
echo " 🚀 ${app_name} →" >> ../../deploy_dist/index.html
echo " </a>" >> ../../deploy_dist/index.html
echo " </li>" >> ../../deploy_dist/index.html
)
fi
done
cat >> deploy_dist/index.html << EOF
</ul>
</body>
</html>
EOF
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./deploy_dist
deploy:
environment:
name: github-pages
url: ${{ github.event.repository.homepage }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4