IAGA-VMOD / IGRF14eval

IAGA V-MOD International Geomagnetic Reference Field 14th generation (IGRF-14) candidate submission and evaluation
https://iaga-vmod.github.io/IGRF14eval/
MIT License
2 stars 16 forks source link

Add workflow config for PR preview to netlify #8

Closed smithara closed 2 months ago

smithara commented 2 months ago

This should make any PR trigger a build and preview to Netlify.

Notebooks are re-executed according to the state of that branch, and a new jupyter-book website is generated and published to a temporary URL on Netlify.

i.e. This PR was previewed at https://66bc9a7e7cf6ac96f876edcf--igrf14eval.netlify.app

The workflow works like:

  1. Execute the notebooks and use jupyter-book to generate the website content (html)
  2. a) If this is a PR: push that html to a unique URL on netlify b) If this is the main branch: push that html to GitHub Pages

Step 1 reports a failure because the notebooks do not execute completely, though the corresponding html is still generated. Step 2a still reports a failure here because it did not successfully add the comment to the PR, which is now fixed by https://github.com/IAGA-VMOD/IGRF14eval/pull/9/commits/8678d1dde995f27438b0f3fc35e76a75b780a0ac (see https://github.com/IAGA-VMOD/IGRF14eval/pull/9 for an example)

image

Netlify is used for the previews for convenience over GitHub pages as it is not yet easy to generate previews from forks on GH pages

GH Actions is authorised to push to the Netlify site by adding the secrets NETLIFY_AUTH_TOKEN & NETLIFY_SITE_ID to https://github.com/IAGA-VMOD/IGRF14eval/settings/secrets/actions