Refactor the docs build workflow (#16265)
Summary:
In preparation for setting up a doc build job for stable docs, I wanted
to refactor the workflow so that future changes will be easier.
This PR the following changes:
- Refactor the doc push script into a reusable command
- Add command line options for the doc push script.
These don't matter too much for now but will be useful
for setting up future jobs for building different versions of the
docs.
- Instead of checking out pytorch/pytorch:master, we re-use the pytorch
installation inside the docker image.
- Change the sed in the script to a perl command. sed is annoyingly
different across platforms; the perl command is more stable
- Run the script in dry run mode (without pushing the doc build)
whenever a PR is opened. This lets us test changes to the doc build workflow.
Test Plan
- I tested the doc build script locally with my own credentials and it
worked fine.
- Wait for the pytorch_doc_push CI.
- After merging this PR, keep an eye on the pytorch_doc_push CI status.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16265
Differential Revision: D13803511
Pulled By: zou3519
fbshipit-source-id: 4564bca3e74d490f89a1d1da9fb8b98eb44bdbb1