Skip to content

feat(graphs): New Edge Attribute: AttributeFromNode #46

feat(graphs): New Edge Attribute: AttributeFromNode

feat(graphs): New Edge Attribute: AttributeFromNode #46

name: Read the Docs PR Preview
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
# Execute this action only on PRs that touch
# documentation files.
paths:
- "**/.readthedocs.yaml"
- "graphs/docs/**"
- "models/docs/**"
- "training/docs/**"
permissions:
pull-requests: write
jobs:
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- name: Detect changed packages
id: changed-packages
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
# For pull requests, compare with the PR base
MERGE_BASE=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.event.pull_request.head.sha }})
CHANGED_FILES=$(git diff --name-only $MERGE_BASE...${{ github.event.pull_request.head.sha }})
elif [ "${{ github.event_name }}" == "push" ]; then
# For pushes, compare with the previous commit
CHANGED_FILES=$(git diff --name-only HEAD^ HEAD)
else
# For scheduled runs, check all files
CHANGED_FILES=$(git ls-files '*.rst')
fi
echo "Changed files:"
echo "$CHANGED_FILES"
echo "training_changed=$(echo "$CHANGED_FILES" | grep -q '^training/' && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
echo "graphs_changed=$(echo "$CHANGED_FILES" | grep -q '^graphs/' && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
echo "models_changed=$(echo "$CHANGED_FILES" | grep -q '^models/' && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
- name: Documentation for training package
if: steps.changed-packages.outputs.training_changed == 'true'
uses: readthedocs/actions/preview@v1
with:
project-slug: "anemoi-training"
- name: Documentation for graphs package
if: steps.changed-packages.outputs.graphs_changed == 'true'
uses: readthedocs/actions/preview@v1
with:
project-slug: "anemoi-graphs"
- name: Documentation for models package
if: steps.changed-packages.outputs.models_changed == 'true'
uses: readthedocs/actions/preview@v1
with:
project-slug: "anemoi-models"