Skip to content

Commit 2bf1c4a

Browse files
authored
Delete and re-create output directory in doc build job (pytorch#16884)
### Summary Testing a fix for doc build jobs timing out.
1 parent 74ea584 commit 2bf1c4a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/doc-build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ jobs:
117117
fi
118118
echo "Target Folder: ${TARGET_FOLDER}"
119119
120-
mkdir -p "${TARGET_FOLDER}"
121120
# Clean up target folder if exists and copy html output to the
122121
# Target folder
123-
rm -rf "${TARGET_FOLDER}"/*
122+
if [ -d "${TARGET_FOLDER}" ]; then
123+
rm -rf "${TARGET_FOLDER}"
124+
fi
125+
mkdir -p "${TARGET_FOLDER}"
124126
mv "${RUNNER_ARTIFACT_DIR}"/html/* "${TARGET_FOLDER}"
125127
git add "${TARGET_FOLDER}" || true
126128

0 commit comments

Comments
 (0)