Skip to content

Commit 2eaddf3

Browse files
authored
ci(docs): Simplify documentation CI (#306)
* Make build-deploy-docs.yml not trigger on PR * Change Build_and_deploy_doc to run in the prod-documentation environment * Change Build_and_deploy_doc job name * Remove cleanup-pr-docs.yml * Revert "docs: Improve `CONTRIBUTING.md` (#303)" * Rename main folder to latest in the built documentation repo
1 parent 37b55ab commit 2eaddf3

File tree

3 files changed

+9
-54
lines changed

3 files changed

+9
-54
lines changed

.github/workflows/build-deploy-docs.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ on:
55
branches: [ main ]
66
tags:
77
- 'v[0-9]*.[0-9]*.[0-9]*'
8-
pull_request:
9-
types: [opened, synchronize, reopened]
108

119
jobs:
12-
Build_and_deploy_doc:
10+
build-deploy-doc:
11+
name: Build & deploy doc
12+
environment: prod-documentation
1313
runs-on: ubuntu-latest
1414
permissions:
1515
contents: write
@@ -33,21 +33,18 @@ jobs:
3333
id: deploy_folder
3434
run: |
3535
echo "Determining deployment folder..."
36-
if [ "${{ github.event_name }}" = "pull_request" ]; then
37-
echo "Deploying to target pr/${{ github.event.number }}"
38-
echo "DEPLOY_DIR=pr/${{ github.event.number }}" >> $GITHUB_OUTPUT
39-
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
36+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
4037
echo "Deploying to target ${{ github.ref_name }}"
4138
echo "DEPLOY_DIR=${{ github.ref_name }}" >> $GITHUB_OUTPUT
4239
else
43-
echo "Deploying to target main"
44-
echo "DEPLOY_DIR=main" >> $GITHUB_OUTPUT
40+
echo "Deploying to target latest"
41+
echo "DEPLOY_DIR=latest" >> $GITHUB_OUTPUT
4542
fi
4643
4744
- name: Deploy to DEPLOY_DIR of TorchJD/documentation
4845
uses: peaceiris/actions-gh-pages@v4
4946
with:
50-
deploy_key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }}
47+
deploy_key: ${{ secrets.PROD_DOCUMENTATION_DEPLOY_KEY }}
5148
publish_dir: docs/build/dirhtml
5249
destination_dir: ${{ steps.deploy_folder.outputs.DEPLOY_DIR }}
5350
external_repository: TorchJD/documentation
@@ -57,7 +54,7 @@ jobs:
5754
if: startsWith(github.ref, 'refs/tags/')
5855
uses: peaceiris/actions-gh-pages@v4
5956
with:
60-
deploy_key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }}
57+
deploy_key: ${{ secrets.PROD_DOCUMENTATION_DEPLOY_KEY }}
6158
publish_dir: docs/build/dirhtml
6259
destination_dir: stable
6360
external_repository: TorchJD/documentation

.github/workflows/cleanup-pr-docs.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ with maintainers before implementing major changes.
4747
pdm run pytest tests/unit tests/doc --cov=src
4848
```
4949

50-
## Building the documentation
51-
52-
### Locally
53-
50+
## Building the documentation locally
5451
- From the `docs` folder, run:
5552
```bash
5653
pdm run make html
@@ -62,13 +59,6 @@ with maintainers before implementing major changes.
6259
pdm run make clean
6360
```
6461

65-
### Online
66-
67-
- When you open a pull request, a GitHub action should build and deploy the documentation, which
68-
will become available at `torchjd.org/pr/<pr_number>`. Additionally, you can click on the check
69-
status of the action, then click on `Summary`, and then click on the link of the built
70-
documentation.
71-
7262
## Development guidelines
7363

7464
The following guidelines should help preserve a good code quality in TorchJD. Contributions that do

0 commit comments

Comments
 (0)