Fix release doc builds (#79865)
This logic were lost during last workflow migration and as result we do not have docs builds for 1.12 release candidate, see pytorch/pytorch.github.io/tree/site/docs
Hattip to @brianjo for reminding me about the issue
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79865
Approved by: https://github.com/atalman, https://github.com/albanD, https://github.com/seemethere