Skip to content

Commit 817cf04

Browse files
committed
Automatically update the docs symlink for new releases - retry
1 parent 9446027 commit 817cf04

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

.github/deploy_docs.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ echo "Aiming to deploy $SOURCE_DIR to $DEST_SLUG branch gh-pages as $DEST_DIR"
107107
# We have to create the SSH key with spaces and new lines, so
108108
# we un-escape whitespace and newline characters to recover
109109
# the SSH deploy key:
110-
python -c "import os; print(os.environ['DOC_KEY'].strip().replace(r'\ ', ' ').replace(r'\n', '\n'))" >$HOME/.biopython_doc_deploy.key
110+
python -c "import os; print(os.environ['DOC_KEY'].strip().replace(r'\ ', ' ').replace(r'\n', '\n'))" > $HOME/.biopython_doc_deploy.key
111111
# Check we have a sane looking line structure:
112112
if [ $(grep -c "^\-\-\-\-\-" $HOME/.biopython_doc_deploy.key) -ne 2 ]; then
113113
echo "ERROR: Failed to rebuild the SSH key,"
@@ -145,6 +145,12 @@ echo "Copying files"
145145
cp -R $SOURCE_DIR/* $DEST_DIR/
146146
echo "Staging files in git"
147147
git add $DEST_DIR/
148+
if [[ "dev" != "$DEST_DIR" ]]; then
149+
echo "Updating version"
150+
rm -rf latest
151+
ln -s $VER latest
152+
git commit latest -m "Automated version bump via ${COMMIT_HASH}"
153+
fi
148154

149155
echo "Preparing to deploy documentation"
150156

@@ -154,13 +160,7 @@ else
154160
echo "Making commit of new files"
155161
git config user.email "sphinx@example.org"
156162
git config user.name "Sphinx"
157-
git commit -m "Automated update ${COMMIT_HASH}"
158-
if [[ "dev" != "$DEST_DIR" ]]; then
159-
echo "Updating version"
160-
rm -rf latest
161-
ln -s $VER latest
162-
git commit latest -m "Automated version bump via ${COMMIT_HASH}"
163-
fi
163+
git commit -m "Biopython $DEST_DIR docs as of ${COMMIT_HASH}"
164164
echo "Finally, pushing to $DEST_SLUG gh-pages branch"
165165
git push origin gh-pages
166166
echo "Documentation deployed!"

0 commit comments

Comments
 (0)