diff --git a/.github/workflows/openanc.yml b/.github/workflows/openanc.yml new file mode 100644 index 0000000000..ae38b73186 --- /dev/null +++ b/.github/workflows/openanc.yml @@ -0,0 +1,44 @@ +name: OpenANC – Pages deploy + optional data refresh +on: + push: { branches: [ main ] } + workflow_dispatch: {} + schedule: [ { cron: '0 11 * * 1' } ] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: { python-version: '3.11' } + - name: Install deps (optional) + run: | + python -m pip install -U pip || true + pip install geopandas shapely pyogrio pandas pydantic || true + - name: Refresh data (optional) + run: | + if [ -f scripts/fetch_sources.py ]; then + mkdir -p .cache/raw + python scripts/fetch_sources.py --out .cache/raw || true + fi + if [ -f scripts/transform.py ]; then + python scripts/transform.py .cache/raw data/ || true + fi + if [ -f scripts/validate.py ]; then + python scripts/validate.py data/ --strict || true + fi + - name: Prepare docs + run: | + mkdir -p docs + if [ ! -f docs/index.html ]; then + echo 'OpenANC

OpenANC

Site coming soon.

' > docs/index.html + fi + - uses: actions/upload-pages-artifact@v3 + with: { path: ./docs } + deploy: + needs: build + permissions: { pages: write, id-token: write } + environment: { name: github-pages, url: ${{ steps.deployment.outputs.page_url }} } + runs-on: ubuntu-latest + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/index.html b/docs/index.html index e751f96d16..1e3e34f652 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,167 +1,4 @@ - - - - - OpenANC : Map View - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
-

Click on the map to see district information - -

-
-

- - - - - \ No newline at end of file + +OpenANC +

OpenANC

+

Static site bootstrap. Data + map coming next.

diff --git a/scripts/config.yaml b/scripts/config.yaml new file mode 100644 index 0000000000..4390ec0e9e --- /dev/null +++ b/scripts/config.yaml @@ -0,0 +1,7 @@ +sources: + anc_boundaries: "" + smd_boundaries: "" + commissioners: "" + candidates: "" +output: + data_dir: "data" diff --git a/scripts/fetch_sources.py b/scripts/fetch_sources.py new file mode 100644 index 0000000000..fcd36251c3 --- /dev/null +++ b/scripts/fetch_sources.py @@ -0,0 +1 @@ +print("fetch: configure real URLs in scripts/config.yaml; skipping for now") diff --git a/scripts/transform.py b/scripts/transform.py new file mode 100644 index 0000000000..337ffc1c5e --- /dev/null +++ b/scripts/transform.py @@ -0,0 +1,7 @@ +import os, json, sys +out = "data"; os.makedirs(out, exist_ok=True) +with open(os.path.join(out, "commissioners.csv"), "w") as f: + f.write("smd,anc,name,email,term_start,term_end\n6B02,6B,Jane Doe,jane@example.org,2025-01-01,2026-12-31\n") +with open(os.path.join(out, "smds.geojson"), "w") as f: + json.dump({"type":"FeatureCollection","features":[]}, f) +print("transform: wrote placeholder data") diff --git a/scripts/validate.py b/scripts/validate.py new file mode 100644 index 0000000000..e2be701bfc --- /dev/null +++ b/scripts/validate.py @@ -0,0 +1 @@ +print("validate: stub (no checks yet)")