Skip to content

Commit 0de59d7

Browse files
committed
task: Restructure site a bit (plain js -> ts)
1 parent 2683262 commit 0de59d7

13 files changed

Lines changed: 1517 additions & 404 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,21 @@ jobs:
3030
run: pip install -U uv
3131
- name: Verify CSVs
3232
run: ./scripts/verify_via_meta.py meta.json.sample
33-
- name: Create meta file
34-
run: |
35-
./scripts/create_meta.py --postcodes postcodes.csv --errormasks errormasks.csv --oserrors oserrors.csv meta.json
36-
- name: Copy files into site-dir
33+
- name: Setup Node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: 22
37+
- name: Build site
3738
run: |
38-
cp meta.json site/
39-
cp *.csv site/
39+
npm ci
40+
npm run build
4041
- name: Upload artifacts
4142
uses: actions/upload-artifact@v4
4243
with:
43-
name: site
44+
name: dist
4445
if-no-files-found: error
4546
path: |
46-
site
47+
dist
4748
4849
deploy:
4950
needs: prepare
@@ -55,16 +56,16 @@ jobs:
5556
steps:
5657
- uses: actions/download-artifact@v4
5758
with:
58-
name: site
59-
path: site
59+
name: dist
60+
path: dist
6061
- name: List current dir
6162
run: ls -R
6263
- name: Setup Pages
6364
uses: actions/configure-pages@v5
6465
- name: Upload artifact
6566
uses: actions/upload-pages-artifact@v3
6667
with:
67-
path: 'site'
68+
path: 'dist'
6869
- name: Deploy to GitHub Pages
6970
id: deployment
7071
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
site/*.csv
22
meta.json
3-
**/__pycache__
3+
**/__pycache__
4+
node_modules
5+
dist

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ To open/edit the CSV files in LibreOffice Calc, use the following settings:
6262

6363
![Libreoffice Calc CSV settings](./assets/csv_libreoffice_calc.png)
6464

65+
## Building the site
66+
67+
The site's client-side logic is written in TypeScript (`src/*.ts`). `site/` holds the static source (HTML, CSS, assets); `npm run build` compiles the TypeScript and assembles the deployable site into `dist/`.
68+
69+
```sh
70+
npm install
71+
npm run build
72+
npm run dev # serves dist/ at http://localhost:3000
73+
```
74+
6575
## Scripts
6676

6777
There are scripts to verify CSVs and also create metadata.

0 commit comments

Comments
 (0)