Skip to content

Commit afab3ad

Browse files
jonphippsclaude
andcommitted
feat: add dev environment and fix workflow triggers
- Add 'dev' environment to DocsEnv and site configurations - Configure dev environment to deploy to https://jonphipps.github.io/standards-dev/ - Create deploy-dev.yml workflow for dev branch deployment - Fix ci-preview.yml to only trigger on main branch pushes/PRs - Remove non-existent 'github' site from configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 7666e25 commit afab3ad

File tree

3 files changed

+285
-6
lines changed

3 files changed

+285
-6
lines changed

.github/workflows/ci-preview.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: build-preview
22
on:
33
push:
4+
branches: [main]
45
pull_request:
6+
branches: [main]
57
workflow_dispatch:
68
inputs:
79
force_build_all:

.github/workflows/deploy-dev.yml

Lines changed: 274 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,274 @@
1+
name: Deploy Dev Environment
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
workflow_dispatch:
8+
inputs:
9+
force_build_all:
10+
description: 'Force build all sites (Portal + all standards)'
11+
required: false
12+
default: 'true'
13+
type: boolean
14+
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
concurrency:
21+
group: "pages-dev"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
build-portal:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup pnpm
32+
uses: pnpm/action-setup@v4
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: '22'
38+
cache: 'pnpm'
39+
40+
- name: Install dependencies
41+
run: pnpm install --frozen-lockfile
42+
43+
- name: Build theme package
44+
run: pnpm build:theme
45+
46+
- name: Build portal
47+
run: pnpm exec docusaurus build portal
48+
env:
49+
BASE_URL: /standards-dev/
50+
NODE_ENV: production
51+
DOCS_ENV: dev
52+
53+
- name: Upload portal artifact
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: portal-build
57+
path: portal/build
58+
retention-days: 1
59+
60+
build-standards:
61+
runs-on: ubuntu-latest
62+
strategy:
63+
matrix:
64+
standard: [ISBDM, LRM, FRBR, isbd, muldicat, unimarc]
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v4
68+
69+
- name: Setup pnpm
70+
uses: pnpm/action-setup@v4
71+
72+
- name: Setup Node.js
73+
uses: actions/setup-node@v4
74+
with:
75+
node-version: '22'
76+
cache: 'pnpm'
77+
78+
- name: Install dependencies
79+
run: pnpm install --frozen-lockfile
80+
81+
- name: Build theme package
82+
run: pnpm build:theme
83+
84+
- name: Build ${{ matrix.standard }}
85+
run: pnpm exec docusaurus build standards/${{ matrix.standard }}
86+
env:
87+
BASE_URL: /standards-dev/${{ matrix.standard }}/
88+
NODE_ENV: production
89+
DOCS_ENV: dev
90+
91+
- name: Upload ${{ matrix.standard }} artifact
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: ${{ matrix.standard }}-build
95+
path: standards/${{ matrix.standard }}/build
96+
retention-days: 1
97+
98+
deploy:
99+
runs-on: ubuntu-latest
100+
needs: [build-portal, build-standards]
101+
steps:
102+
- name: Create deployment directory
103+
run: mkdir -p deployment
104+
105+
- name: Download portal build
106+
uses: actions/download-artifact@v4
107+
with:
108+
name: portal-build
109+
path: deployment/
110+
111+
- name: Download ISBDM build
112+
uses: actions/download-artifact@v4
113+
with:
114+
name: ISBDM-build
115+
path: deployment/ISBDM
116+
117+
- name: Download LRM build
118+
uses: actions/download-artifact@v4
119+
with:
120+
name: LRM-build
121+
path: deployment/LRM
122+
123+
- name: Download FRBR build
124+
uses: actions/download-artifact@v4
125+
with:
126+
name: FRBR-build
127+
path: deployment/FRBR
128+
129+
- name: Download isbd build
130+
uses: actions/download-artifact@v4
131+
with:
132+
name: isbd-build
133+
path: deployment/isbd
134+
135+
- name: Download muldicat build
136+
uses: actions/download-artifact@v4
137+
with:
138+
name: muldicat-build
139+
path: deployment/muldicat
140+
141+
- name: Download unimarc build
142+
uses: actions/download-artifact@v4
143+
with:
144+
name: unimarc-build
145+
path: deployment/unimarc
146+
147+
- name: Create standards index
148+
run: |
149+
cat > deployment/standards.html << 'INDEXEOF'
150+
<!DOCTYPE html>
151+
<html>
152+
<head>
153+
<title>IFLA Standards - Dev Environment</title>
154+
<meta charset="utf-8">
155+
<meta name="viewport" content="width=device-width, initial-scale=1">
156+
<style>
157+
body {
158+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
159+
max-width: 800px;
160+
margin: 0 auto;
161+
padding: 2rem;
162+
background: #f5f5f5;
163+
}
164+
.container {
165+
background: white;
166+
padding: 2rem;
167+
border-radius: 8px;
168+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
169+
}
170+
h1 {
171+
color: #333;
172+
margin-bottom: 0.5rem;
173+
}
174+
.subtitle {
175+
color: #666;
176+
margin-bottom: 2rem;
177+
}
178+
.env-badge {
179+
background: #ff6b35;
180+
color: white;
181+
padding: 0.25rem 0.75rem;
182+
border-radius: 4px;
183+
font-size: 0.8rem;
184+
font-weight: 600;
185+
margin-left: 1rem;
186+
}
187+
ul {
188+
list-style: none;
189+
padding: 0;
190+
}
191+
li {
192+
margin: 1rem 0;
193+
}
194+
a {
195+
display: block;
196+
padding: 1rem;
197+
background: #f8f9fa;
198+
color: #0066cc;
199+
text-decoration: none;
200+
border-radius: 4px;
201+
border: 1px solid #e9ecef;
202+
transition: all 0.2s;
203+
}
204+
a:hover {
205+
background: #e9ecef;
206+
border-color: #dee2e6;
207+
transform: translateX(4px);
208+
}
209+
.standard-name {
210+
font-weight: 600;
211+
display: block;
212+
margin-bottom: 0.25rem;
213+
}
214+
.standard-desc {
215+
font-size: 0.875rem;
216+
color: #666;
217+
}
218+
</style>
219+
</head>
220+
<body>
221+
<div class="container">
222+
<h1>IFLA Standards Documentation <span class="env-badge">DEV</span></h1>
223+
<p class="subtitle">International Federation of Library Associations and Institutions</p>
224+
<ul>
225+
<li>
226+
<a href="./ISBDM/">
227+
<span class="standard-name">ISBDM</span>
228+
<span class="standard-desc">International Standard Bibliographic Description for Manifestations</span>
229+
</a>
230+
</li>
231+
<li>
232+
<a href="./LRM/">
233+
<span class="standard-name">LRM</span>
234+
<span class="standard-desc">Library Reference Model</span>
235+
</a>
236+
</li>
237+
<li>
238+
<a href="./FRBR/">
239+
<span class="standard-name">FRBR</span>
240+
<span class="standard-desc">Functional Requirements</span>
241+
</a>
242+
</li>
243+
<li>
244+
<a href="./isbd/">
245+
<span class="standard-name">ISBD</span>
246+
<span class="standard-desc">International Standard Bibliographic Description</span>
247+
</a>
248+
</li>
249+
<li>
250+
<a href="./muldicat/">
251+
<span class="standard-name">MulDiCat</span>
252+
<span class="standard-desc">Multilingual Dictionary of Cataloguing Terms</span>
253+
</a>
254+
</li>
255+
<li>
256+
<a href="./unimarc/">
257+
<span class="standard-name">UNIMARC</span>
258+
<span class="standard-desc">Universal Machine-Readable Cataloguing</span>
259+
</a>
260+
</li>
261+
</ul>
262+
</div>
263+
</body>
264+
</html>
265+
INDEXEOF
266+
267+
- name: Deploy to GitHub Pages
268+
uses: JamesIves/github-pages-deploy-action@v4
269+
with:
270+
repository-name: jonphipps/standards-dev
271+
token: ${{ secrets.GITHUB_TOKEN }}
272+
branch: gh-pages
273+
folder: deployment
274+
clean: true
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
export enum DocsEnv {
22
Localhost = 'localhost',
33
Preview = 'preview',
4+
Dev = 'dev',
45
Production = 'production',
56
}
67

7-
export type SiteKey = 'portal' | 'ISBDM' | 'LRM' | 'FRBR' | 'isbd' | 'muldicat' | 'unimarc' | 'github';
8+
export type SiteKey = 'portal' | 'ISBDM' | 'LRM' | 'FRBR' | 'isbd' | 'muldicat' | 'unimarc';
89

910
export interface SiteConfig {
1011
url: string;
@@ -18,41 +19,43 @@ export const sites: Record<SiteKey, Record<DocsEnv, SiteConfig>> = {
1819
portal: {
1920
[DocsEnv.Localhost]: { url: 'http://localhost:3000', baseUrl: '/portal/', port: 3000 },
2021
[DocsEnv.Preview]: { url: 'https://iflastandards.github.io', baseUrl: '/standards-dev/', port: 3000 },
22+
[DocsEnv.Dev]: { url: 'https://jonphipps.github.io', baseUrl: '/standards-dev/', port: 3000 },
2123
[DocsEnv.Production]: { url: 'https://iflastandards.info', baseUrl: '/', port: 3000 },
2224
},
2325
ISBDM: {
2426
[DocsEnv.Localhost]: { url: 'http://localhost:3001', baseUrl: '/ISBDM/', port: 3001 },
2527
[DocsEnv.Preview]: { url: 'https://iflastandards.github.io', baseUrl: '/standards-dev/ISBDM/', port: 3001 },
28+
[DocsEnv.Dev]: { url: 'https://jonphipps.github.io', baseUrl: '/standards-dev/ISBDM/', port: 3001 },
2629
[DocsEnv.Production]: { url: 'https://iflastandards.info', baseUrl: '/ISBDM/', port: 3001 },
2730
},
2831
LRM: {
2932
[DocsEnv.Localhost]: { url: 'http://localhost:3002', baseUrl: '/LRM/', port: 3002 },
3033
[DocsEnv.Preview]: { url: 'https://iflastandards.github.io', baseUrl: '/standards-dev/LRM/', port: 3002 },
34+
[DocsEnv.Dev]: { url: 'https://jonphipps.github.io', baseUrl: '/standards-dev/LRM/', port: 3002 },
3135
[DocsEnv.Production]: { url: 'https://iflastandards.info', baseUrl: '/LRM/', port: 3002 },
3236
},
3337
FRBR: {
3438
[DocsEnv.Localhost]: { url: 'http://localhost:3003', baseUrl: '/FRBR/', port: 3003 },
3539
[DocsEnv.Preview]: { url: 'https://iflastandards.github.io', baseUrl: '/standards-dev/FRBR/', port: 3003 },
40+
[DocsEnv.Dev]: { url: 'https://jonphipps.github.io', baseUrl: '/standards-dev/FRBR/', port: 3003 },
3641
[DocsEnv.Production]: { url: 'https://iflastandards.info', baseUrl: '/FRBR/', port: 3003 },
3742
},
3843
isbd: {
3944
[DocsEnv.Localhost]: { url: 'http://localhost:3004', baseUrl: '/isbd/', port: 3004 },
4045
[DocsEnv.Preview]: { url: 'https://iflastandards.github.io', baseUrl: '/standards-dev/isbd/', port: 3004 },
46+
[DocsEnv.Dev]: { url: 'https://jonphipps.github.io', baseUrl: '/standards-dev/isbd/', port: 3004 },
4147
[DocsEnv.Production]: { url: 'https://iflastandards.info', baseUrl: '/isbd/', port: 3004 },
4248
},
4349
muldicat: {
4450
[DocsEnv.Localhost]: { url: 'http://localhost:3005', baseUrl: '/muldicat/', port: 3005 },
4551
[DocsEnv.Preview]: { url: 'https://iflastandards.github.io', baseUrl: '/standards-dev/muldicat/', port: 3005 },
52+
[DocsEnv.Dev]: { url: 'https://jonphipps.github.io', baseUrl: '/standards-dev/muldicat/', port: 3005 },
4653
[DocsEnv.Production]: { url: 'https://iflastandards.info', baseUrl: '/muldicat/', port: 3005 },
4754
},
4855
unimarc: {
4956
[DocsEnv.Localhost]: { url: 'http://localhost:3006', baseUrl: '/unimarc/', port: 3006 },
5057
[DocsEnv.Preview]: { url: 'https://iflastandards.github.io', baseUrl: '/standards-dev/unimarc/', port: 3006 },
58+
[DocsEnv.Dev]: { url: 'https://jonphipps.github.io', baseUrl: '/standards-dev/unimarc/', port: 3006 },
5159
[DocsEnv.Production]: { url: 'https://iflastandards.info', baseUrl: '/unimarc/', port: 3006 },
5260
},
53-
github: {
54-
[DocsEnv.Localhost]: { url: 'http://localhost:3007', baseUrl: '/github/', port: 3007 },
55-
[DocsEnv.Preview]: { url: 'https://iflastandards.github.io', baseUrl: '/standards-dev/github/', port: 3007 },
56-
[DocsEnv.Production]: { url: 'https://iflastandards.info', baseUrl: '/github/', port: 3007 },
57-
},
5861
};

0 commit comments

Comments
 (0)