diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 3d0777c..c8c835a 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -6,12 +6,21 @@ on: repository_dispatch: types: [content-update] workflow_dispatch: + # Weekly rebuild to pick up Google Sheet changes (publications, social feed): + # Monday 00:00 Sri Lanka time (UTC+5:30) = Sunday 18:30 UTC. + schedule: + - cron: "30 18 * * 0" permissions: contents: read pages: write id-token: write +# One deployment at a time; a run that starts while another is deploying waits instead of failing. +concurrency: + group: pages + cancel-in-progress: false + jobs: build: runs-on: ubuntu-latest @@ -21,7 +30,7 @@ jobs: uses: actions/checkout@v5 - name: Print trigger info - run: echo "Triggered by ${{ github.event.client_payload.source }}" + run: echo "Triggered by ${{ github.event.client_payload.source || github.event_name }}" - name: Prepare site inputs uses: ./.github/actions/prepare-site diff --git a/README.md b/README.md index d7028b8..cc335dd 100644 --- a/README.md +++ b/README.md @@ -66,17 +66,17 @@ These entries are cloned into the website build as the news collection. ## :bar_chart: Google Sheet data source -The website also pulls structured data from this Google Sheet: -- `https://docs.google.com/spreadsheets/d/1vhvcqlhc_bTdGScX3iYQ4T9HTD2uLbKD22rsrI_qA8U/edit?usp=sharing` +The website also pulls structured data from two Google Sheets: +- **MARC Publications** (one tab per project, the main publications source): `https://docs.google.com/spreadsheets/d/15PZaRMJgW67znlJmfxWFvE1iHpc4NrFmBHFR3n7ldWc/edit?usp=sharing` +- **Website data** (the original publications list and the social feed / social news items): `https://docs.google.com/spreadsheets/d/1vhvcqlhc_bTdGScX3iYQ4T9HTD2uLbKD22rsrI_qA8U/edit?usp=sharing` -This sheet is used for: -- publications -- social feed / social news items - -During the update/build flow, the Python script [`python_scripts/get_data.py`](https://github.com/pdnMARC/pdnmarc.github.io/blob/main/python_scripts/get_data.py) downloads CSV exports from the relevant sheet tabs and writes: +During the update/build flow, the Python script [`python_scripts/get_data.py`](https://github.com/pdnMARC/pdnmarc.github.io/blob/main/python_scripts/get_data.py) downloads exports of the sheets and writes: +- `src/collection_publications/project_publications.json` - `src/collection_publications/publications.json` - `src/collection_news/social_news.json` +The sheets are read on every deployment, and the deploy workflow also runs every Monday at 00:00 Sri Lanka time, so sheet changes go live within a week even when nothing else changes. + So the website has two kinds of news-related content: - full Markdown news articles from [`marc_news`](https://github.com/pdnMARC/marc_news) - shorter social feed items from the Google Sheet @@ -85,6 +85,8 @@ So the website has two kinds of news-related content: The deployment workflow lives at [`.github/workflows/deploy.yaml`](https://github.com/pdnMARC/pdnmarc.github.io/blob/main/.github/workflows/deploy.yaml). +It runs on a push to `main`, when a content repository reports a merged change, every Monday at 00:00 Sri Lanka time (Sunday 18:30 UTC), and on demand from the **Actions** tab. + At a high level it does the following: 1. Checks out this repository. 2. Removes local debug content collections. diff --git a/src/pages/docs/index.astro b/src/pages/docs/index.astro index 3e320e1..8c85771 100644 --- a/src/pages/docs/index.astro +++ b/src/pages/docs/index.astro @@ -283,7 +283,8 @@ const keys = [

- Google Sheet changes (publications, social feed) are picked up at the next rebuild. Need edit access to a sheet or + Google Sheet changes (publications, social feed) are picked up at the next rebuild, and at the latest by the + weekly rebuild every Monday at 00:00 Sri Lanka time. Need edit access to a sheet or repository? Email {site.email}.

diff --git a/src/pages/docs/publications.mdx b/src/pages/docs/publications.mdx index a1562a5..87159d1 100644 --- a/src/pages/docs/publications.mdx +++ b/src/pages/docs/publications.mdx @@ -88,6 +88,11 @@ listed last. ## When changes appear -The sheet is read when the website rebuilds. That happens whenever a change is merged into the website -or one of the content repositories. To publish sheet changes straight away, a maintainer can run the -**Deploy to GitHub Pages** workflow from the website repository's **Actions** tab (**Run workflow**). +The sheet is read when the website rebuilds. That happens **every Monday at 00:00 Sri Lanka time**, so +new papers and corrections made during the week are live by Monday morning. The website also rebuilds +whenever a change is merged into the website or one of the content repositories. To publish sheet +changes straight away, a maintainer can run the **Deploy to GitHub Pages** workflow from the website +repository's **Actions** tab (**Run workflow**). + +If a rebuild fails, the live site stays as it was. Check the run in the **Actions** tab: a renamed +column heading is the usual cause. diff --git a/src/pages/docs/site.mdx b/src/pages/docs/site.mdx index df7051d..1a2dbd1 100644 --- a/src/pages/docs/site.mdx +++ b/src/pages/docs/site.mdx @@ -106,8 +106,14 @@ The live site is built and deployed by the **Deploy to GitHub Pages** workflow. - a change is pushed to the website's `main` branch; - a change is merged into `main` in one of the content repositories; +- every Monday at 00:00 Sri Lanka time (Sunday 18:30 UTC), to pick up changes in the Google Sheets + (publications and the social feed); - a maintainer runs it by hand from the **Actions** tab (**Run workflow**), for example after editing the Google Sheets. +GitHub turns off scheduled runs in a public repository after 60 days without any commits. If that +happens, GitHub emails the repository admins and the workflow shows a banner in the **Actions** tab; +select **Enable workflow** to turn the weekly rebuild back on. + Pull requests to the website are built (but not deployed) by the **PR Build Check** workflow, so problems show up before merging.