Skip to content

Commit a1b9c56

Browse files
authored
ci: stop storing the package tables in git (#154)
1 parent 9dfc3f9 commit a1b9c56

15 files changed

Lines changed: 120 additions & 11973 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ on:
33
push:
44
branches:
55
- main
6-
workflow_run:
7-
workflows: ["Update package table"]
8-
types: [completed]
6+
# The package tables live only in the deployed site, not in git; the schedule
7+
# is what keeps them fresh.
8+
schedule:
9+
- cron: "0 */6 * * *"
10+
workflow_dispatch:
911

1012
# ghp-import force-pushes gh-pages; two runs racing each other could publish
1113
# the older build last.
@@ -16,14 +18,25 @@ concurrency:
1618
jobs:
1719
deploy:
1820
runs-on: ubuntu-latest
19-
# Only redeploy for a table refresh that actually succeeded; a push to main
20-
# deploys unconditionally.
21-
if: github.event_name == 'push' || github.event.workflow_run.conclusion == 'success'
21+
# workflow_dispatch can be pointed at any branch; only main may deploy.
22+
if: github.ref == 'refs/heads/main'
2223
# `ghp-import --push` pushes the built site to the gh-pages branch
2324
permissions:
2425
contents: write
2526
steps:
2627
# ghp-import pushes with the credentials persisted by checkout
2728
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2829
- uses: prefix-dev/setup-pixi@f00437f565399d418b0acc85936d12c1fb668347 # v0.10.1
30+
# Regenerates every distro with a dataChannel in src/data/distros.json;
31+
# a distro without one (foxy, galactic) is a committed snapshot. A failed
32+
# distro does not stop the deploy: the ensure-tables task inside
33+
# build-docs falls back to the currently deployed copy for whatever is
34+
# missing, and the run is marked failed at the end.
35+
- name: Update tables
36+
id: update
37+
continue-on-error: true
38+
run: pixi run update-tables
2939
- run: pixi run gh-deploy
40+
- name: Surface update failures
41+
if: steps.update.outcome == 'failure'
42+
run: exit 1

‎.github/workflows/update-package-table.yml‎

Lines changed: 0 additions & 52 deletions
This file was deleted.

‎.gitignore‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ dist
1212

1313
# pnpm package store
1414
.pnpm-store
15+
16+
# Package tables; regenerated by the deploy workflow, downloaded from the
17+
# deployed site everywhere else. foxy and galactic have no data channel left
18+
# to regenerate from, so their snapshots stay committed.
19+
public/data/*.json
20+
!public/data/foxy.json
21+
!public/data/galactic.json

‎README.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ the common header:
1010
`src/components/home/`
1111
- the package pages - one per distro, generated by `src/pages/[distro].astro`
1212
from `src/data/distros.ts`; the tables render in the browser from
13-
`public/data/<distro>.json`
13+
`public/data/<distro>.json`, which the deploy workflow regenerates from the
14+
conda channels every six hours and which `serve` and `build-docs` download
15+
from the deployed site when the local copy is missing or older than six
16+
hours (only the foxy and galactic snapshots are committed)
1417
- the documentation - the Markdown files in `src/content/docs/`
1518

1619
The header is Starlight's own, with the wordmark supplied by the

‎pixi.toml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ pnpm-install = {
1414
}
1515
serve = {
1616
cmd = "pnpm run dev",
17-
depends-on = ["pnpm-install"],
17+
depends-on = ["pnpm-install", "ensure-tables"],
1818
description = "Serve the site locally",
1919
}
2020
build-docs = {
2121
cmd = "pnpm run build",
22-
depends-on = ["pnpm-install"],
22+
depends-on = ["pnpm-install", "ensure-tables"],
2323
description = "Build the site",
2424
}
2525
gh-deploy = {
@@ -95,6 +95,10 @@ update-tables = {
9595
cmd = "python scripts/compare_pkg_completeness.py --all",
9696
description = "Regenerate the package tables for every distro the pipeline maintains",
9797
}
98+
ensure-tables = {
99+
cmd = "python scripts/ensure_tables.py",
100+
description = "Download the deployed package tables where the local copy is missing or older than 6 hours",
101+
}
98102

99103
[environments]
100104
default = ["site", "lint", "scripts"]

‎public/data/humble.json‎

Lines changed: 0 additions & 2299 deletions
This file was deleted.

‎public/data/jazzy.json‎

Lines changed: 0 additions & 2259 deletions
This file was deleted.

‎public/data/kilted.json‎

Lines changed: 0 additions & 1757 deletions
This file was deleted.

‎public/data/lyrical.json‎

Lines changed: 0 additions & 1786 deletions
This file was deleted.

‎public/data/noetic.json‎

Lines changed: 0 additions & 2177 deletions
This file was deleted.

0 commit comments

Comments
 (0)