diff --git a/.github/workflows/readthedocs-pr-update.yml b/.github/workflows/readthedocs-pr-update.yml new file mode 100644 index 00000000..51429321 --- /dev/null +++ b/.github/workflows/readthedocs-pr-update.yml @@ -0,0 +1,31 @@ +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: + - "graphs/docs/**" + - "models/docs/**" + - "training/docs/**" + +permissions: + pull-requests: write + +jobs: + documentation: + runs-on: ubuntu-latest + strategy: + matrix: + project: + - { path: 'graphs/docs/', slug: 'anemoi-graphs' } + - { path: 'models/docs/', slug: 'anemoi-models' } + - { path: 'training/docs/', slug: 'anemoi-training' } + if: contains(github.event.pull_request.files.*.path, matrix.project.path) + steps: + - uses: readthedocs/actions/preview@v1 + with: + project-slug: ${{ matrix.project.slug }}