Skip to content

Commit

Permalink
Merge branch 'main' into eqctier3-8fb95b6f-11bb-44f8-a1b8-a3953512d144
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Jan 7, 2025
2 parents b46eda8 + baf5a75 commit bf768d7
Show file tree
Hide file tree
Showing 58 changed files with 23,329 additions and 232 deletions.
27 changes: 12 additions & 15 deletions .github/ISSUE_TEMPLATE/notebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ body:
description: Choose the data type.
multiple: false
options:
- Climate Projection
- Climate Projection - CMIP6
- Climate Projection - CORDEX
- In Situ
- Reanalyses
- Satellite ECVs - Atmosphere Physics
- Satellite ECVs - Atmospheric Composition
- Satellite ECVs - Cryosphere
- Satellite ECVs - Land Biosphere
- Satellite ECVs - Land Hydrology & Cryosphere
- Satellite ECVs - Land Hydrology
- Satellite ECVs - Ocean
- Seasonal Forecasts
validations:
Expand All @@ -28,18 +30,13 @@ body:
description: Choose the CIM quality assessment category.
multiple: false
options:
- Climate And Weather Extremes
- Climate Impact Indicators
- Climate Monitoring
- Consistency Assessment
- Data Completeness
- Forecast Skill
- Intercomparison
- Mean
- Model Performance
- Trend Assessment
- Uncertainty
- Variability
- completeness
- consistency
- extremes-detection
- resolution
- timeliness
- uncertainty-quality-flags
- validation
validations:
required: true

Expand Down Expand Up @@ -103,4 +100,4 @@ body:
label: Anything else we need to know?
description: Describe any other information you want to share.
validations:
required: true
required: false
31 changes: 31 additions & 0 deletions .github/workflows/deploy-book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: deploy-book

on:
push:
branches:
- main
workflow_dispatch:

env:
PRE_BUILD_DIR: "_pre_build"

jobs:
deploy-book:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- run: pip install -r requirements.txt
- run: make build-book PRE_BUILD_DIR=${{ env.PRE_BUILD_DIR }}
- run: touch ${{ env.PRE_BUILD_DIR }}/_build/html/.nojekyll
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: "${{ env.PRE_BUILD_DIR }}/_build/html"
# See: https://github.com/marketplace/actions/deploy-pr-preview#ensure-your-main-deployment-is-compatible
clean-exclude: pr-preview/
force: false
131 changes: 131 additions & 0 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: on-pull-request
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PRE_BUILD_DIR: "_pre_build"
PRE_BUILD_FLAGS: "--disclaimer"

defaults:
run:
shell: bash -l {0}

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: pre-commit/action@v3.0.1

deploy-preview:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- run: git fetch origin gh-pages
- uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- uses: actions/checkout@v4
- name: Get changed notebooks
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
**.ipynb
- name: Remove untouched notebooks
id: remove-untouched-notebooks
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |-
for file in ${ALL_CHANGED_FILES}; do
mv "$file" "$file".keep
done
find . -type f -name "*.ipynb" -not -path "./templates/*" -exec rm -f {} +
for file in ${ALL_CHANGED_FILES}; do
mv "$file".keep "$file"
done
- run: pip install -r requirements.txt
- run: make build-book PRE_BUILD_DIR=${{ env.PRE_BUILD_DIR }} PRE_BUILD_FLAGS=${{ env.PRE_BUILD_FLAGS }}
- uses: rossjrw/pr-preview-action@v1
if: steps.changed-files.outputs.any_changed == 'true'
with:
source-dir: "${{ env.PRE_BUILD_DIR }}/_build/html"

comment-pr:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Get changed notebooks
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
**.ipynb
- name: Build permalinks
id: build-permalinks
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |-
permalinks="<ul>"
for fullfile in ${ALL_CHANGED_FILES}; do
fullfile="${fullfile//\\&/&}"
commit=$(git rev-list -1 HEAD "$fullfile")
suffix="${fullfile//&/%26}"
url=${{ github.server_url }}/${{ github.repository }}/blob/$commit/$suffix
permalinks+="<li><a href=\"$url\">$url</a></li>"
done
permalinks+="</ul>"
echo "permalinks=$permalinks" >>"$GITHUB_OUTPUT"
- name: Build URLs
id: build-urls
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |-
permalinks="<ul>"
previews="<ul>"
for fullfile in ${ALL_CHANGED_FILES}; do
fullfile="${fullfile//\\&/&}"
commit=$(git rev-list -1 HEAD "$fullfile")
suffix="${fullfile//&/%26}"
permalink=${{ github.server_url }}/${{ github.repository }}/blob/$commit/$suffix
permalinks+="<li><a href=\"$permalink\">$permalink</a></li>"
suffix="${fullfile/.ipynb/.html}"
preview=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.number }}/$suffix
previews+="<li><a href=\"$preview\">$preview</a></li>"
done
permalinks+="</ul>"
echo "permalinks=$permalinks" >>"$GITHUB_OUTPUT"
previews+="</ul>"
echo "previews=$previews" >>"$GITHUB_OUTPUT"
- name: Comment PR with permalinks
uses: thollander/actions-comment-pull-request@v3
with:
message: |
**Permalinks:**
${{ steps.build-urls.outputs.permalinks }}
comment-tag: permalinks
- name: Comment PR with previews
uses: thollander/actions-comment-pull-request@v3
with:
message: |
**Previews:**
${{ steps.build-urls.outputs.previews }}
comment-tag: previews
21 changes: 0 additions & 21 deletions .github/workflows/on-push.yml

This file was deleted.

Loading

0 comments on commit bf768d7

Please sign in to comment.