diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 8d9081615be..cc91062fe36 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -82,41 +82,10 @@ jobs: upload-gh-pages: needs: build - if: github.repository == 'pytorch/executorch' && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) permissions: - id-token: write contents: write - uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main + uses: pytorch/test-infra/.github/workflows/_upload_docs.yml@main with: + docs-branch: gh-pages + docs-name: docs repository: pytorch/executorch - download-artifact: docs - ref: gh-pages - timeout: 90 - script: | - set -euo pipefail - - # Get github.ref for the output doc folder. By default "main" - # If matches a tag like refs/tags/v1.12.0-rc3 or - # refs/tags/v1.12.0 convert to 1.12 - export GITHUB_REF=${{ github.ref }} - - # Convert refs/tags/v1.12.0rc3 into 1.12. - # Adopted from https://github.com/pytorch/pytorch/blob/main/.github/workflows/_docs.yml#L150C11-L155C13 - if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+) ]]; then - TARGET_FOLDER="${BASH_REMATCH[1]}" - else - TARGET_FOLDER="main" - fi - echo "Target Folder: ${TARGET_FOLDER}" - - mkdir -p "${TARGET_FOLDER}" - # Clean up target folder if exists and copy html output to the - # Target folder - rm -rf "${TARGET_FOLDER}"/* - mv "${RUNNER_ARTIFACT_DIR}"/html/* "${TARGET_FOLDER}" - git add "${TARGET_FOLDER}" || true - - git config user.name 'pytorchbot' - git config user.email 'soumith+bot@pytorch.org' - git commit -m "Auto-generating sphinx docs" || true - git push -f