Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH Actions: add an "update website" workflow
This new workflow will run when: * A new release of Requests has been published. * A pull request has been send in which updates the scripts which are involved in updating the website. The workflow can also be manually triggered, but will not run in forks of this repo (as they can't update or publish the website). :point_right: Open question: should the workflow always run for pushes to `stable` ? Those will normally be the release pushes and the "next" version nr may not be known yet in that case, but if something is "off" with the website, an update to regen the website would now require a new tag (or manual trigger, but we'll have to see how well that works for this). The script will: * In the `prepare` job: - (Re-)Generate the API docs using phpDocumentor. - Prepare the `README` and the files in the `docs` directory for use in the website. - Upload the results as an artifact. The artifact will only be available for one day as it's only used in the next job. * In the `createpr` job: - Download the artifact. - Remove outdated files and replace them with the newly generated ones. Note: files can be updated, as well as added/removed, so for the commits we need to make sure that both tracked as well as untracked changes are committed. - Create a PR to the `gh-pages` branch containing two commits: 1. A commit for the API docs update. This commit _may_ be empty if no inline docs have been updated, though I suspect that will be exceedingly rare. 2. A commit containing the remaining changes (docs + homepage). For PRs created because the workflow or the associated scripts have changed, the PR title will be prefixed with `[TEST | DO NOT MERGE]` so the effect of workflow/script changes can still be verified, without updating the website with the docs for an unreleased `develop` version of Requests. For those PRs, the website change PR will be based on the feature branch against `develop` as otherwise the action doesn't have access to the latest version of the workflow/scripts. For releases and manual triggering, the website change PR will always be based on the `stable` branch. Note: these steps could be combined into one job, but for debugging, it felt cleaner to separate it into two jobs. :point_right: Note: we'll need to monitor if a PR correctly gets created when there are no changes to the prose docs (committed via the `create-pr` action), but there are API doc changes (committed manually), I hope it will be, but we'll have to see. Refs: * https://github.com/marketplace/actions/create-pull-request * https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md
- Loading branch information