Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Commit

Permalink
Fix deploying new docs to old stable tag (#1598)
Browse files Browse the repository at this point in the history
* Fix deploying new docs to old stable tag

Previously, we relied on inferring the tag from `git describe`.  This
has been somewhat unreliable in the past, seemingly not recognising the
newest tag when triggered.  It is possible that the VM's git checkout
is initialised before the tag is synced into the main repo, which might
have caused this.

Instead, we extract the tag from the environment variable GitHub Actions
sets to pass to the deployment script directly.  This is guaranteed to
give the correct tag.

* Force use of bash
  • Loading branch information
jakelishman authored Sep 14, 2022
1 parent 7e61ef0 commit 2cbf527
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docs_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ jobs:
encrypted_rclone_key: ${{ secrets.encrypted_rclone_key }}
encrypted_rclone_iv: ${{ secrets.encrypted_rclone_iv }}
QISKIT_DOCS_BUILD_TUTORIALS: 'always'
shell: bash
run: |
tools/deploy_documentation_tag.sh
tools/deploy_documentation_tag.sh ${GITHUB_REF#refs/tags/}
9 changes: 7 additions & 2 deletions tools/deploy_documentation_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,22 @@
# Script for pushing the stable documentation.
set -e

if [ $# -ne 1 ]; then
echo "Usage: $(basename "$0") <tag>" >&2 && exit 1
fi

curl https://downloads.rclone.org/rclone-current-linux-amd64.deb -o rclone.deb
sudo apt-get install -y ./rclone.deb

RCLONE_CONFIG_PATH=$(rclone config file | tail -1)

echo "show current dir: "
pwd

CURRENT_TAG=`git describe --abbrev=0`
CURRENT_TAG=$1
echo "Got tag $CURRENT_TAG"
IFS=. read -ra VERSION <<< "$CURRENT_TAG"
STABLE_VERSION="${VERSION[0]}.${VERSION[1]}"
echo "Building for stable version $STABLE_VERSION"

# Build the documentation.
tox -edocs -- -D content_prefix=documentation/stable/"$STABLE_VERSION" -j auto
Expand Down

0 comments on commit 2cbf527

Please sign in to comment.