From f247c785cb9f18f790b92f0f5595865570cde06d Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Tue, 1 Apr 2025 22:10:23 +0200 Subject: [PATCH 01/18] Update Build and deploy docs CI to be able to publish docs for PR, tags and main. Also clean up docs related to PRs when the PR is closed. --- .github/workflows/build-deploy-docs.yml | 70 +++++++++++++++++++++++++ .github/workflows/cleanup-pr-docs.yml | 34 ++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 .github/workflows/build-deploy-docs.yml create mode 100644 .github/workflows/cleanup-pr-docs.yml diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml new file mode 100644 index 00000000..07f05973 --- /dev/null +++ b/.github/workflows/build-deploy-docs.yml @@ -0,0 +1,70 @@ +name: Build and Deploy Documentation + +on: + push: + branches: [ main ] + tags: + - 'v[0-9]*.[0-9]*.[0-9]*' + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup PDM + uses: pdm-project/setup-pdm@v4 + with: + python-version: '3.12' + + - name: Install dependencies (default & doc) + run: pdm install --group doc --frozen-lockfile + + - name: Build Documentation + working-directory: docs + run: pdm run make dirhtml + + - name: Determine deployment folder + id: deploy_folder + run: | + echo "Determining deployment folder..." + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "Deploying to target pr/${{ github.event.number }}" + echo "DEPLOY_DIR=pr/${{ github.event.number }}" >> $GITHUB_OUTPUT + elif [[ "${{ github.ref }}" == refs/tags/* ]]; then + echo "Deploying to target ${{ github.ref_name }}" + echo "DEPLOY_DIR=${{ github.ref_name }}" >> $GITHUB_OUTPUT + else + echo "Deploying to target main" + echo "DEPLOY_DIR=main" >> $GITHUB_OUTPUT + fi + + - name: Deploy Documentation to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/build/dirhtml + destination_dir: ${{ steps.deploy_folder.outputs.DEPLOY_DIR }} + publish_branch: gh-pages + + - name: Update default site redirect (tag event only) + if: startsWith(github.ref, 'refs/tags/') + run: | + # Extract the tag name from the GITHUB_REF variable. + TAG_NAME=${GITHUB_REF##*/} + # Create an index.html file that redirects to //index.html. + echo "" > docs/build/index.html + # Clone the gh-pages branch using token authentication + git clone --branch gh-pages https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} gh-pages + cp docs/build/index.html gh-pages/index.html + cd gh-pages + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git add index.html + git commit -m "Update default documentation redirect to tag ${GITHUB_REF##*/}" || echo "No changes to commit" + git push origin gh-pages diff --git a/.github/workflows/cleanup-pr-docs.yml b/.github/workflows/cleanup-pr-docs.yml new file mode 100644 index 00000000..f4669993 --- /dev/null +++ b/.github/workflows/cleanup-pr-docs.yml @@ -0,0 +1,34 @@ +name: Cleanup PR Documentation + +on: + pull_request: + types: [closed] + +jobs: + cleanup: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v4 + with: + repository: ${{ github.repository }} + ref: gh-pages + token: ${{ secrets.GITHUB_TOKEN }} + path: gh-pages + + - name: Remove PR documentation for closed PR + run: | + PR_NUMBER="${{ github.event.number }}" + echo "Removing documentation for PR #${PR_NUMBER}" + rm -rf gh-pages/pr/${PR_NUMBER} + + - name: Commit and push cleanup + working-directory: gh-pages + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git add . + git commit -m "Cleanup documentation for closed PR #${{ github.event.number }}" || echo "No changes to commit" + git push origin HEAD:gh-pages From 63d00b4ce4793dba7d8b4fa6d7bc1178071a271b Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Wed, 2 Apr 2025 09:51:01 +0200 Subject: [PATCH 02/18] Make stable replicate the last published tag with format "vX.Y.Z" --- .github/workflows/build-deploy-docs.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 07f05973..5f5c12f5 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -54,17 +54,9 @@ jobs: - name: Update default site redirect (tag event only) if: startsWith(github.ref, 'refs/tags/') - run: | - # Extract the tag name from the GITHUB_REF variable. - TAG_NAME=${GITHUB_REF##*/} - # Create an index.html file that redirects to //index.html. - echo "" > docs/build/index.html - # Clone the gh-pages branch using token authentication - git clone --branch gh-pages https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} gh-pages - cp docs/build/index.html gh-pages/index.html - cd gh-pages - git config user.name "github-actions" - git config user.email "github-actions@github.com" - git add index.html - git commit -m "Update default documentation redirect to tag ${GITHUB_REF##*/}" || echo "No changes to commit" - git push origin gh-pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/build/dirhtml + destination_dir: stable + publish_branch: gh-pages From 8a4b10122c053c1c457c9b31fca8c0ca69a9ce35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 02:18:24 +0200 Subject: [PATCH 03/18] Use python 3.13 instead of 3.12 When I suggested Python 3.13.1 instead of 3.12.3 in `CONTRIBUTING.md` (4ed413ee), I should have also changed the python version of build_deploy_documentation.yml to 3.13, but I forgot. The reason is that I think it's better to use the latest Python version whenever we can, whether it be for users, contributors or even github actions. Since this PR will also end up with the removal of build_deploy_documentation.yml, I think it's a good time to also update Python to 3.13 in the new build-deploy-docs.yml file. --- .github/workflows/build-deploy-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 5f5c12f5..ec3caa00 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -20,7 +20,7 @@ jobs: - name: Setup PDM uses: pdm-project/setup-pdm@v4 with: - python-version: '3.12' + python-version: '3.13' - name: Install dependencies (default & doc) run: pdm install --group doc --frozen-lockfile From 506f310d97c8edce4d2f8f04cbf03228d4329874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 02:26:48 +0200 Subject: [PATCH 04/18] Change github_repository to be TorchJD/documentation instead of the default --- .github/workflows/build-deploy-docs.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index ec3caa00..c7c0c073 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -50,7 +50,8 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: docs/build/dirhtml destination_dir: ${{ steps.deploy_folder.outputs.DEPLOY_DIR }} - publish_branch: gh-pages + github_repository: TorchJD/documentation.github.io + publish_branch: main - name: Update default site redirect (tag event only) if: startsWith(github.ref, 'refs/tags/') @@ -59,4 +60,5 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: docs/build/dirhtml destination_dir: stable - publish_branch: gh-pages + github_repository: TorchJD/documentation.github.io + publish_branch: main From 8ee2e4004fa6519375795baa2a4f17cf35e2f867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 02:31:29 +0200 Subject: [PATCH 05/18] Rename github_repository to external_repository --- .github/workflows/build-deploy-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index c7c0c073..044183ac 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -50,7 +50,7 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: docs/build/dirhtml destination_dir: ${{ steps.deploy_folder.outputs.DEPLOY_DIR }} - github_repository: TorchJD/documentation.github.io + external_repository: TorchJD/documentation.github.io publish_branch: main - name: Update default site redirect (tag event only) @@ -60,5 +60,5 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: docs/build/dirhtml destination_dir: stable - github_repository: TorchJD/documentation.github.io + external_repository: TorchJD/documentation.github.io publish_branch: main From 7b8b2732ce4275c0919f52082bfd90e53a0278f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 02:36:57 +0200 Subject: [PATCH 06/18] Change github_token to actions_deploy_key - As suggested in https://github.com/peaceiris/actions-gh-pages/pull/36 --- .github/workflows/build-deploy-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 044183ac..6a7cfbcf 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -47,7 +47,7 @@ jobs: - name: Deploy Documentation to GitHub Pages uses: peaceiris/actions-gh-pages@v4 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + actions_deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} publish_dir: docs/build/dirhtml destination_dir: ${{ steps.deploy_folder.outputs.DEPLOY_DIR }} external_repository: TorchJD/documentation.github.io @@ -57,7 +57,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') uses: peaceiris/actions-gh-pages@v4 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + actions_deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} publish_dir: docs/build/dirhtml destination_dir: stable external_repository: TorchJD/documentation.github.io From 824d933e3844cd7cc0b3dfea7877b0f9817a6590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 02:59:14 +0200 Subject: [PATCH 07/18] Change actions_deploy_key to secrets.DOCUMENTATION_DEPLOY_KEY - This is to match the name of the secret that I just created in the settings of TorchJD/torchjd --- .github/workflows/build-deploy-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 6a7cfbcf..5cd474b2 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -47,7 +47,7 @@ jobs: - name: Deploy Documentation to GitHub Pages uses: peaceiris/actions-gh-pages@v4 with: - actions_deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} + actions_deploy_key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }} publish_dir: docs/build/dirhtml destination_dir: ${{ steps.deploy_folder.outputs.DEPLOY_DIR }} external_repository: TorchJD/documentation.github.io @@ -57,7 +57,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') uses: peaceiris/actions-gh-pages@v4 with: - actions_deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} + actions_deploy_key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }} publish_dir: docs/build/dirhtml destination_dir: stable external_repository: TorchJD/documentation.github.io From 308306e37721cd175fda694d53c6cfc5ada0520d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 03:02:11 +0200 Subject: [PATCH 08/18] Rename actions_deploy_key to deploy_key --- .github/workflows/build-deploy-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 5cd474b2..25bf4bca 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -47,7 +47,7 @@ jobs: - name: Deploy Documentation to GitHub Pages uses: peaceiris/actions-gh-pages@v4 with: - actions_deploy_key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }} + deploy_key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }} publish_dir: docs/build/dirhtml destination_dir: ${{ steps.deploy_folder.outputs.DEPLOY_DIR }} external_repository: TorchJD/documentation.github.io @@ -57,7 +57,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') uses: peaceiris/actions-gh-pages@v4 with: - actions_deploy_key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }} + deploy_key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }} publish_dir: docs/build/dirhtml destination_dir: stable external_repository: TorchJD/documentation.github.io From 4be26ad3418536d7b09516f14b1857234ca82cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 03:09:08 +0200 Subject: [PATCH 09/18] Remove .github.io from repo name --- .github/workflows/build-deploy-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 25bf4bca..cec87993 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -50,7 +50,7 @@ jobs: deploy_key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }} publish_dir: docs/build/dirhtml destination_dir: ${{ steps.deploy_folder.outputs.DEPLOY_DIR }} - external_repository: TorchJD/documentation.github.io + external_repository: TorchJD/documentation publish_branch: main - name: Update default site redirect (tag event only) @@ -60,5 +60,5 @@ jobs: deploy_key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }} publish_dir: docs/build/dirhtml destination_dir: stable - external_repository: TorchJD/documentation.github.io + external_repository: TorchJD/documentation publish_branch: main From ff43932f6c99adae30bbf9e2fc8568032e711767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 03:51:25 +0200 Subject: [PATCH 10/18] Rename some steps for clarity --- .github/workflows/build-deploy-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index cec87993..3f09d9a5 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -44,7 +44,7 @@ jobs: echo "DEPLOY_DIR=main" >> $GITHUB_OUTPUT fi - - name: Deploy Documentation to GitHub Pages + - name: Deploy to DEPLOY_DIR of TorchJD/documentation uses: peaceiris/actions-gh-pages@v4 with: deploy_key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }} @@ -53,7 +53,7 @@ jobs: external_repository: TorchJD/documentation publish_branch: main - - name: Update default site redirect (tag event only) + - name: Deploy to stable of TorchJD/documentation if: startsWith(github.ref, 'refs/tags/') uses: peaceiris/actions-gh-pages@v4 with: From e723b8fea06f2e2e50c6bd1bd9e12ef5f72a2067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 03:52:30 +0200 Subject: [PATCH 11/18] Add link to documentation in summary --- .github/workflows/build-deploy-docs.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 3f09d9a5..23802298 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -62,3 +62,7 @@ jobs: destination_dir: stable external_repository: TorchJD/documentation publish_branch: main + + - name: Add documentation link to summary + run: | + echo "### 📄 [View Deployed Documentation](https://https://torchjd.github.io/documentation/${{ steps.deploy_folder.outputs.DEPLOY_DIR }})" >> $GITHUB_STEP_SUMMARY From 7ae4b9542a565ac64533a79c3ea41ee8a939bb3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 03:55:46 +0200 Subject: [PATCH 12/18] Fix link --- .github/workflows/build-deploy-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 23802298..104fcddb 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -65,4 +65,4 @@ jobs: - name: Add documentation link to summary run: | - echo "### 📄 [View Deployed Documentation](https://https://torchjd.github.io/documentation/${{ steps.deploy_folder.outputs.DEPLOY_DIR }})" >> $GITHUB_STEP_SUMMARY + echo "### 📄 [View Deployed Documentation](https://torchjd.github.io/documentation/${{ steps.deploy_folder.outputs.DEPLOY_DIR }})" >> $GITHUB_STEP_SUMMARY From af1b2b1bd9dd90dea4f1a9cd6ae988e5559de97d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 04:05:46 +0200 Subject: [PATCH 13/18] Add step to create check run with doc link --- .github/workflows/build-deploy-docs.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 104fcddb..b11725bb 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -63,6 +63,21 @@ jobs: external_repository: TorchJD/documentation publish_branch: main - - name: Add documentation link to summary - run: | - echo "### 📄 [View Deployed Documentation](https://torchjd.github.io/documentation/${{ steps.deploy_folder.outputs.DEPLOY_DIR }})" >> $GITHUB_STEP_SUMMARY + - name: Create Check Run with Docs Link + uses: actions/github-script@v7 + with: + script: | + const repo = context.repo; + const url = `https://torchjd.github.io/documentation/${{ steps.deploy_folder.outputs.DEPLOY_DIR }}`; + + const checkRun = await github.rest.checks.create({ + owner: repo.owner, + repo: repo.repo, + name: "📘 View Documentation", + head_sha: context.payload.pull_request.head.sha, + status: "completed", + conclusion: "success", + details_url: url + }); + + console.log(`Check Run Created: ${checkRun.data.html_url}`); From a22b96a644838cd881eb15126530b745f32119f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 04:09:28 +0200 Subject: [PATCH 14/18] Revert "Add step to create check run with doc link" This reverts commit af1b2b1bd9dd90dea4f1a9cd6ae988e5559de97d. --- .github/workflows/build-deploy-docs.yml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index b11725bb..104fcddb 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -63,21 +63,6 @@ jobs: external_repository: TorchJD/documentation publish_branch: main - - name: Create Check Run with Docs Link - uses: actions/github-script@v7 - with: - script: | - const repo = context.repo; - const url = `https://torchjd.github.io/documentation/${{ steps.deploy_folder.outputs.DEPLOY_DIR }}`; - - const checkRun = await github.rest.checks.create({ - owner: repo.owner, - repo: repo.repo, - name: "📘 View Documentation", - head_sha: context.payload.pull_request.head.sha, - status: "completed", - conclusion: "success", - details_url: url - }); - - console.log(`Check Run Created: ${checkRun.data.html_url}`); + - name: Add documentation link to summary + run: | + echo "### 📄 [View Deployed Documentation](https://torchjd.github.io/documentation/${{ steps.deploy_folder.outputs.DEPLOY_DIR }})" >> $GITHUB_STEP_SUMMARY From 3363dd86ad1a553124ca2bc2ebc8c30282ae79c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 14:44:06 +0200 Subject: [PATCH 15/18] Change the repository and branch that cleanup-pr-docs.yml writes to --- .github/workflows/cleanup-pr-docs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cleanup-pr-docs.yml b/.github/workflows/cleanup-pr-docs.yml index f4669993..3566f19a 100644 --- a/.github/workflows/cleanup-pr-docs.yml +++ b/.github/workflows/cleanup-pr-docs.yml @@ -13,9 +13,9 @@ jobs: - name: Checkout gh-pages branch uses: actions/checkout@v4 with: - repository: ${{ github.repository }} - ref: gh-pages - token: ${{ secrets.GITHUB_TOKEN }} + repository: TorchJD/documentation + ref: main + ssh-key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }} path: gh-pages - name: Remove PR documentation for closed PR @@ -31,4 +31,4 @@ jobs: git config user.email "github-actions@github.com" git add . git commit -m "Cleanup documentation for closed PR #${{ github.event.number }}" || echo "No changes to commit" - git push origin HEAD:gh-pages + git push origin HEAD:main From 3095e699abe4dd26506f7a46fc5967a71a4e8c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 14:46:03 +0200 Subject: [PATCH 16/18] Remove gh-pages folder from the path to which cleanup-pr-docs.yml writes --- .github/workflows/cleanup-pr-docs.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/cleanup-pr-docs.yml b/.github/workflows/cleanup-pr-docs.yml index 3566f19a..9f1109da 100644 --- a/.github/workflows/cleanup-pr-docs.yml +++ b/.github/workflows/cleanup-pr-docs.yml @@ -16,16 +16,14 @@ jobs: repository: TorchJD/documentation ref: main ssh-key: ${{ secrets.DOCUMENTATION_DEPLOY_KEY }} - path: gh-pages - name: Remove PR documentation for closed PR run: | PR_NUMBER="${{ github.event.number }}" echo "Removing documentation for PR #${PR_NUMBER}" - rm -rf gh-pages/pr/${PR_NUMBER} + rm -rf pr/${PR_NUMBER} - name: Commit and push cleanup - working-directory: gh-pages run: | git config user.name "github-actions" git config user.email "github-actions@github.com" From a9db3a0bc5b0bf466281ee4ff4f12b81a163bbc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 14:51:10 +0200 Subject: [PATCH 17/18] Add workflow_dispatch trigger to cleanup-pr-docs.yml --- .github/workflows/cleanup-pr-docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cleanup-pr-docs.yml b/.github/workflows/cleanup-pr-docs.yml index 9f1109da..11bc773c 100644 --- a/.github/workflows/cleanup-pr-docs.yml +++ b/.github/workflows/cleanup-pr-docs.yml @@ -3,6 +3,7 @@ name: Cleanup PR Documentation on: pull_request: types: [closed] + workflow_dispatch: jobs: cleanup: From ddc23d653d56c0319108037af89839a7f7205d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Fri, 4 Apr 2025 15:07:43 +0200 Subject: [PATCH 18/18] Remove workflow_dispatch trigger from cleanup-pr-docs.yml --- .github/workflows/cleanup-pr-docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cleanup-pr-docs.yml b/.github/workflows/cleanup-pr-docs.yml index 11bc773c..9f1109da 100644 --- a/.github/workflows/cleanup-pr-docs.yml +++ b/.github/workflows/cleanup-pr-docs.yml @@ -3,7 +3,6 @@ name: Cleanup PR Documentation on: pull_request: types: [closed] - workflow_dispatch: jobs: cleanup: