Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/pages/docs/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ const keys = [
</li>
</ol>
<p class="mt-8 text-[0.9375rem]">
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 <a href={`mailto:${site.email}`} class="text-primary underline">{site.email}</a>.
</p>
</section>
Expand Down
11 changes: 8 additions & 3 deletions src/pages/docs/publications.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 6 additions & 0 deletions src/pages/docs/site.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading