Skip to content

Commit 8dc631b

Browse files
committed
Add workflow to deploy website
1 parent aab9845 commit 8dc631b

File tree

2 files changed

+95
-12
lines changed

2 files changed

+95
-12
lines changed

.github/workflows/deploy-pages.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Generate and Deploy GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
# Allow manual triggering
7+
workflow_dispatch:
8+
9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
# Build job
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v4
31+
with:
32+
python-version: '3.12'
33+
34+
- name: Generate index.html
35+
run: |
36+
cd docs
37+
python generate_index.py
38+
rm README.md
39+
40+
- name: Setup Pages
41+
uses: actions/configure-pages@v4
42+
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v3
45+
with:
46+
# Upload docs directory
47+
path: './docs'
48+
49+
# Deployment job
50+
deploy:
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
runs-on: ubuntu-latest
55+
needs: build
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

docs/README.md

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,43 @@
1-
## Running
1+
# SWT-Bench Documentation Site
22

3-
To generate the website, run the following command.
4-
```bash
5-
python3 generate_index.py
6-
```
3+
This directory contains the source files for the SWT-Bench leaderboard website that is automatically deployed to GitHub Pages.
4+
5+
## Files
6+
7+
- `generate_index.py` - Python script that generates the final `index.html` from the template and CSV data
8+
- `index.template.html` - HTML template for the leaderboard page
9+
- `runs.csv` - Model performance data
10+
- `orgs.csv` - Organization/provider information
11+
- `approaches.csv` - Approach/paper mapping data
12+
- `static/` - Static assets (CSS, JS, images)
13+
14+
## Automatic Deployment
15+
16+
The site is automatically built and deployed to GitHub Pages via the `.github/workflows/deploy-pages.yml` workflow:
17+
18+
1. **Triggers**: Runs on pushes to the `main` branch, pull requests, or manual dispatch
19+
2. **Build Process**:
20+
- Checks out the repository
21+
- Sets up Python 3.11
22+
- Runs `generate_index.py` to create the final HTML
23+
- Uploads the entire `docs/` directory as a Pages artifact
24+
3. **Deployment**: Deploys to GitHub Pages (only on pushes to `main`)
25+
26+
## Manual Generation
27+
28+
To generate the site locally:
729

8-
Then serve it using the following command.
930
```bash
10-
$ python3 -m http.server 8080
31+
cd docs
32+
python generate_index.py
1133
```
1234

13-
## Adding a new approach
35+
This will create/update the `index.html` file based on the current CSV data and template.
36+
37+
## GitHub Pages Configuration
1438

15-
To add a new approach, do the following:
39+
Make sure GitHub Pages is configured in your repository settings:
40+
1. Go to Settings → Pages
41+
2. Set Source to "GitHub Actions"
42+
3. The workflow will handle the rest automatically
1643

17-
1) Add the approach to `approaches.csv`
18-
2) Add the organization to `orgs.csv`
19-
3) Add the specific run(s) to `runs.csv` (i.e., verified and lite if applicable)

0 commit comments

Comments
 (0)