Repository navigation
210 lines (180 loc) Β· 7.53 KB
/
Copy pathdeploy.yml
File metadata and controls
210 lines (180 loc) Β· 7.53 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: Deploy
on:
workflow_run:
workflows: ["Release"]
types: [completed]
branches: [main]
# Also trigger on direct changes to demos or docs
push:
branches: [main]
paths:
- 'demos/**'
- 'docs/**'
- '.github/workflows/deploy.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Only run if Release workflow succeeded or on direct push to demos/docs
if: >
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') ||
(github.event_name == 'push')
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node & Install
uses: ./.github/actions/setup-node
with:
node-version: '20.x'
- name: Try to download cached build artifacts
id: download-build
continue-on-error: true
uses: actions/download-artifact@v5
with:
name: build-${{ github.sha }}-20.x
path: .
- name: Build main package if no cached artifacts
if: steps.download-build.outcome == 'failure'
run: |
npm run build
npm run build --workspace=packages/forge-react
- name: Try to download cached Storybook artifacts
id: download-storybook
continue-on-error: true
uses: actions/download-artifact@v5
with:
name: storybook-${{ github.sha }}
path: storybook-static/
- name: Build Storybook if no cached artifacts
if: steps.download-storybook.outcome == 'failure'
run: npm run build-storybook
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Create docs site structure
run: |
mkdir -p _site
# Copy main documentation
cp -r docs/* _site/
# Copy built Storybook
cp -r storybook-static _site/storybook
# Create main index.html
cat > _site/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forge UI Component Library</title>
<style>
body { font-family: system-ui, sans-serif; max-width: 800px; margin: 2rem auto; padding: 0 1rem; }
h1 { color: #3b82f6; }
.card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 1.5rem; margin: 1rem 0; }
.button { display: inline-block; padding: 0.5rem 1rem; background: #3b82f6; color: white; text-decoration: none; border-radius: 6px; margin: 0.5rem 0.5rem 0.5rem 0; }
.button:hover { background: #2563eb; }
</style>
</head>
<body>
<h1>π₯ Forge UI Component Library</h1>
<p>The FIRST AI-Native component library built for the age of AI-assisted development.</p>
<div class="card">
<h2>π Documentation</h2>
<a href="./components/" class="button">Component Docs</a>
<a href="./guides/" class="button">Guides</a>
<a href="./patterns/" class="button">Patterns</a>
</div>
<div class="card">
<h2>π¨ Interactive Showcase</h2>
<a href="./storybook/" class="button">Storybook</a>
</div>
<div class="card">
<h2>π» Live Demos</h2>
<a href="./demos/nextjs/" class="button">Next.js Demo</a>
<a href="./demos/react/" class="button">React Demo (Coming Soon)</a>
<a href="./demos/vue/" class="button">Vue Demo (Coming Soon)</a>
<a href="./demos/vanilla/" class="button">Vanilla JS Demo (Coming Soon)</a>
</div>
<div class="card">
<h2>π Quick Start</h2>
<pre><code>npm install @nexcraft/forge</code></pre>
<p>Visit our <a href="https://github.com/dev-ignis/forge">GitHub repository</a> for complete documentation.</p>
</div>
</body>
</html>
EOF
- name: Install Next.js demo dependencies
run: |
cd demos/nextjs-app
npm ci --legacy-peer-deps
- name: Build Next.js demo
run: |
cd demos/nextjs-app
npm run build
- name: Copy Next.js demo to site
run: |
mkdir -p _site/demos/nextjs
cp -r demos/nextjs-app/out/* _site/demos/nextjs/
- name: Create demos index
run: |
mkdir -p _site/demos
cat > _site/demos/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forge UI Demos</title>
<style>
body { font-family: system-ui, sans-serif; max-width: 800px; margin: 2rem auto; padding: 0 1rem; }
h1 { color: #3b82f6; }
.demo { border: 1px solid #e5e7eb; border-radius: 8px; padding: 1.5rem; margin: 1rem 0; }
.button { display: inline-block; padding: 0.5rem 1rem; background: #3b82f6; color: white; text-decoration: none; border-radius: 6px; margin: 0.5rem 0.5rem 0.5rem 0; }
.button:hover { background: #2563eb; }
.status { padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.875rem; }
.available { background: #dcfce7; color: #166534; }
.coming-soon { background: #fef3c7; color: #92400e; }
</style>
</head>
<body>
<h1>π₯ Forge UI Demos</h1>
<p>Production-quality applications showcasing Forge components in real-world scenarios.</p>
<div class="demo">
<h2>Next.js Demo <span class="status available">β
Available</span></h2>
<p>Full-featured Next.js application with SSR, React Hook Form integration, and Tailwind CSS.</p>
<a href="./nextjs/" class="button">View Live Demo</a>
<a href="https://github.com/dev-ignis/forge/tree/main/demos/nextjs-app" class="button">View Source</a>
</div>
<div class="demo">
<h2>React Demo <span class="status coming-soon">π§ Coming Soon</span></h2>
<p>Pure React application with Vite showcasing component integration patterns.</p>
</div>
<div class="demo">
<h2>Vue Demo <span class="status coming-soon">π§ Coming Soon</span></h2>
<p>Vue 3 Composition API application demonstrating web components integration.</p>
</div>
<div class="demo">
<h2>Vanilla JS Demo <span class="status coming-soon">π§ Coming Soon</span></h2>
<p>Zero-dependency implementation using native Web Components API.</p>
</div>
<p><a href="../">β Back to Main Documentation</a></p>
</body>
</html>
EOF
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./_site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4