Skip to content

Conversation

@m-aciek
Copy link
Collaborator

@m-aciek m-aciek commented Feb 1, 2025

Lightweight version of previews.

Based on GH Pages and deploying to subdirectory (using ${{ github.ref_name }}: for pull requests: merge/[pr-number]). Adds a link only after a successful build. Removes the preview directory after the pull request close.

  • Solves the problem of previews not working after the repository move
  • Should lower the maintenance burden (RTD project configuration)
  • Should give us more flexibility (avoiding e.g. time/resources limits of RTD builds)

For now I'm modifying the PR not to remove RTD just yet, rather add the second preview in every PR.


📊 Dashboard preview 📊: https://python-docs-translations.github.io/dashboard/46/merge/


📊 Dashboard preview 📊: https://python-docs-translations.github.io/dashboard/main/

@m-aciek m-aciek closed this Feb 1, 2025
@m-aciek m-aciek reopened this Feb 1, 2025
@m-aciek m-aciek changed the title Deploy to subfolder in PRs Deploy to subfolders for pull requests Feb 1, 2025
@hugovk
Copy link
Member

hugovk commented Feb 1, 2025

What's the motivation for this?

@m-aciek
Copy link
Collaborator Author

m-aciek commented Feb 1, 2025

Read the docs have a build timeout limit of 30 minutes. We may be breaking it if we push forward with #45 (may be not needed for that, if the parallelization will be successful).

This is a proof of concept for potential switch with preview to GitHub pages.

@m-aciek
Copy link
Collaborator Author

m-aciek commented Feb 1, 2025

The preview returns 404 now, because the main branch deploys have a "clean" flag toggled on, so they wipe out every other file at their deploy.

@hugovk
Copy link
Member

hugovk commented Feb 2, 2025

Read the docs have a build timeout limit of 30 minutes. We may be breaking it if we push forward with #45 (may be not needed for that, if the parallelization will be successful).

Ah right.

The preview returns 404 now, because the main branch deploys have a "clean" flag toggled on, so they wipe out every other file at their deploy.

After toggling the flag, does this mean the repo will keep all the subfolders "forever"? Do we need a mechanism to remove old subfolders after some time? I guess it's just a couple of files per subfolder, so not such a problem.

@m-aciek
Copy link
Collaborator Author

m-aciek commented Feb 2, 2025

After toggling the flag, does this mean the repo will keep all the subfolders "forever"? Do we need a mechanism to remove old subfolders after some time? I guess it's just a couple of files per subfolder, so not such a problem.

For the sake of cleanliness, indeed it would be worth to add some mechanism to remove subfolders. It would be probably a new workflow triggered on PR close, that would checkout the gh-pages branch, git rm the PR preview directory, commit and push.

For the reference, a related discussion in the GH pages deployment GitHub repo discussions: JamesIves/github-pages-deploy-action#645 (comment).

@m-aciek m-aciek closed this Feb 5, 2025
@m-aciek m-aciek reopened this Feb 5, 2025
@m-aciek m-aciek marked this pull request as ready for review February 5, 2025 14:54
@m-aciek m-aciek merged commit f165f5d into main Feb 6, 2025
1 check passed
@m-aciek m-aciek deleted the gh-pages-preview branch February 6, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants