Fix doc build for release branches (#72567)
Summary:
Add "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" wildcard to tag triggers
Add similar `startsWith(github.event.ref, 'refs/tags/v1.')` for push
conditions
Fixes https://github.com/pytorch/pytorch/issues/72519
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72567
Reviewed By: atalman
Differential Revision: D34116048
Pulled By: malfet
fbshipit-source-id: 7ef6ae3972ff7eba213ae9c4eb4afea5a7e11827
(cherry picked from commit 3785553532ccf636e389c97713f2c5bbfec836ba)