Skip to content

Commit 9b24050

Browse files
committed
ci: publish output viewer to gh pages
1 parent cffe8d1 commit 9b24050

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/deploy-pages.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['output/**']
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Prepare static files
25+
run: cp output/viewer.html output/index.html
26+
27+
- name: Upload artifact
28+
uses: actions/upload-pages-artifact@v3
29+
with:
30+
path: output/
31+
32+
- name: Deploy to GitHub Pages
33+
id: deployment
34+
uses: actions/deploy-pages@v4

output/viewer.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,16 @@ <h3>All Runs</h3>
618618
try { render(parseCSV(text)); } catch(e) { console.error(e); }
619619
}).catch(() => {});
620620
}
621+
622+
// Auto-load results.csv when served from a web server (e.g. GitHub Pages)
623+
if (!csvUrl && window.location.protocol.startsWith('http')) {
624+
fetch('results.csv').then(r => {
625+
if (r.ok) return r.text();
626+
throw new Error('Not found');
627+
}).then(text => {
628+
try { render(parseCSV(text)); } catch(e) { console.error(e); }
629+
}).catch(() => {});
630+
}
621631
</script>
622632
</body>
623633
</html>

0 commit comments

Comments
 (0)