-
Notifications
You must be signed in to change notification settings - Fork 1
125 lines (114 loc) · 3.57 KB
/
preview-pages.yml
File metadata and controls
125 lines (114 loc) · 3.57 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
name: Deploy Preview Pages
on:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages-preview
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
env:
VITE_SEEVOMAP_HF_CLIENT_ID: ${{ secrets.VITE_SEEVOMAP_HF_CLIENT_ID }}
steps:
- name: Checkout preview branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Configure Pages
uses: actions/configure-pages@v5
with:
enablement: true
- name: Build preview site bundle
run: |
npm ci
npm run build
test -f dist/oauth/client-metadata.json
test -f dist/.nojekyll
test -f dist/oauth/callback/huggingface/index.html
test -f dist/generated/offline_quality_fixture.json
rm -rf ../preview-site
mkdir -p ../preview-site/preview/docs-autoresearch-preview
cp -R dist/. ../preview-site/preview/docs-autoresearch-preview/
- name: Build current main site for root
run: |
git worktree add ../main-site origin/main
cd ../main-site
npm ci
npm run build
if [ ! -f dist/oauth/client-metadata.json ] && [ ! -f dist/.well-known/oauth-cimd ]; then
echo "Expected either dist/oauth/client-metadata.json or dist/.well-known/oauth-cimd in the root-site build"
exit 1
fi
test -f dist/.nojekyll
test -f dist/oauth/callback/huggingface/index.html
test -f dist/generated/offline_quality_fixture.json
cp -R dist/. ../preview-site/
- name: Add preview landing page
run: |
cat <<'EOF' > ../preview-site/preview/index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SeevoMap Preview</title>
<style>
body {
margin: 0;
font-family: ui-sans-serif, system-ui, sans-serif;
background: #060b12;
color: #e6edf3;
display: grid;
min-height: 100vh;
place-items: center;
}
main {
max-width: 720px;
padding: 32px;
}
a {
color: #38bdf8;
}
</style>
</head>
<body>
<main>
<h1>SeevoMap Preview Pages</h1>
<p>
Preview branch builds live under dedicated subpaths so the root site
can stay aligned with <code>main</code>.
</p>
<ul>
<li>
<a href="./docs-autoresearch-preview/">
docs-autoresearch-preview
</a>
</li>
</ul>
</main>
</body>
</html>
EOF
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ../preview-site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4