Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
19b2d3ca
Unverified
Commit
19b2d3ca
authored
May 17, 2023
by
Philip Meier
Committed by
GitHub
May 17, 2023
Browse files
reinstate doc upload (#7580)
parent
99ec261c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
1 deletion
+61
-1
.github/workflows/docs.yml
.github/workflows/docs.yml
+61
-1
No files found.
.github/workflows/docs.yml
View file @
19b2d3ca
...
@@ -7,6 +7,9 @@ on:
...
@@ -7,6 +7,9 @@ on:
-
nightly
-
nightly
-
main
-
main
-
release/*
-
release/*
tags
:
-
v[0-9]+.[0-9]+.[0-9]
-
v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
workflow_dispatch
:
workflow_dispatch
:
jobs
:
jobs
:
...
@@ -14,6 +17,7 @@ jobs:
...
@@ -14,6 +17,7 @@ jobs:
uses
:
pytorch/test-infra/.github/workflows/linux_job.yml@main
uses
:
pytorch/test-infra/.github/workflows/linux_job.yml@main
with
:
with
:
repository
:
pytorch/vision
repository
:
pytorch/vision
upload-artifact
:
docs
script
:
|
script
:
|
set -euo pipefail
set -euo pipefail
...
@@ -44,4 +48,60 @@ jobs:
...
@@ -44,4 +48,60 @@ jobs:
sed -i -e 's/-j auto/-j 1/' Makefile
sed -i -e 's/-j auto/-j 1/' Makefile
make html
make html
mv build/html/* "${RUNNER_DOCS_DIR}"
cp -r build/html "${RUNNER_ARTIFACT_DIR}"
# On PRs we also want to upload the docs into our S3 bucket for preview.
if [[ ${{ github.event_name == 'pull_request' }} ]]; then
cp -r build/html/* "${RUNNER_DOCS_DIR}"
fi
upload
:
needs
:
build
if
:
github.repository == 'pytorch/vision' && github.event_name == 'push' &&
((github.ref_type == 'branch' && github.ref_name == 'main') || github.ref_type == 'tag')
permissions
:
contents
:
write
uses
:
pytorch/test-infra/.github/workflows/linux_job.yml@main
with
:
repository
:
pytorch/vision
download-artifact
:
docs
ref
:
gh-pages
script
:
|
set -euo pipefail
REF_TYPE=${{ github.ref_type }}
REF_NAME=${{ github.ref_name }}
if [[ "${REF_TYPE}" == branch ]]; then
TARGET_FOLDER="${REF_NAME}"
elif [[ "${REF_TYPE}" == tag ]]; then
case "${REF_NAME}" in
*-rc*)
echo "Aborting upload since this is an RC tag: ${REF_NAME}"
exit 0
;;
*)
# Strip the leading "v" as well as the trailing patch version. For example:
# 'v0.15.2' -> '0.15'
TARGET_FOLDER=$(echo "${REF_NAME}" | sed 's/v\([0-9]\+\)\.\([0-9]\+\)\.[0-9]\+/\1.\2/')
;;
esac
fi
echo "Target Folder: ${TARGET_FOLDER}"
mkdir -p "${TARGET_FOLDER}"
rm -rf "${TARGET_FOLDER}"/*
mv "${RUNNER_ARTIFACT_DIR}"/html/* "${TARGET_FOLDER}"
git add "${TARGET_FOLDER}" || true
if [[ "${TARGET_FOLDER}" == main ]]; then
mkdir -p _static
rm -rf _static/*
cp -r "${TARGET_FOLDER}"/_static/* _static
git add _static || true
fi
git config user.name 'pytorchbot'
git config user.email 'soumith+bot@pytorch.org'
git commit -m "auto-generating sphinx docs" || true
git push
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment