From aa1ad42736a296211effd3b0a320a8057e3552f5 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Wed, 25 Mar 2020 20:01:11 +0100 Subject: [PATCH] Also deploy from the beta branch --- .github/deploy.sh | 10 +++++++++- .github/workflows/deploy.yml | 4 ++++ util/gh-pages/versions.html | 1 + util/versions.py | 2 ++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/deploy.sh b/.github/deploy.sh index 9ef9678ee..3f425e5b7 100644 --- a/.github/deploy.sh +++ b/.github/deploy.sh @@ -17,6 +17,11 @@ if [[ -n $TAG_NAME ]]; then ln -s "$TAG_NAME" out/stable fi +if [[ $BETA = "true" ]]; then + echo "Update documentation for the beta release" + cp -r out/master out/beta +fi + # Generate version index that is shown as root index page cp util/gh-pages/versions.html out/index.html @@ -35,12 +40,15 @@ fi if [[ -n $TAG_NAME ]]; then # Add the new dir - git add $TAG_NAME + git add "$TAG_NAME" # Update the symlink git add stable # Update versions file git add versions.json git commit -m "Add documentation for ${TAG_NAME} release: ${SHA}" +elif [[ $BETA = "true" ]]; then + git add beta + git commit -m "Automatic deploy to GitHub Pages (beta): ${SHA}" else git add . git commit -m "Automatic deploy to GitHub Pages: ${SHA}" diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5b7bec819..10033daf0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - beta tags: - rust-1.** @@ -34,6 +35,9 @@ jobs: run: | TAG=$(basename ${{ github.ref }}) echo "::set-env name=TAG_NAME::$TAG" + - name: Set beta to true + if: github.ref == 'refs/heads/beta' + run: echo "::set-env name=BETA::true" - name: Deploy run: | eval "$(ssh-agent -s)" diff --git a/util/gh-pages/versions.html b/util/gh-pages/versions.html index cd3611db3..6e810a349 100644 --- a/util/gh-pages/versions.html +++ b/util/gh-pages/versions.html @@ -65,6 +65,7 @@ $scope.versionOrder = function(v) { if (v === 'master') { return Infinity; } if (v === 'stable') { return Number.MAX_VALUE; } + if (v === 'beta') { return Number.MAX_VALUE - 1; } return $scope.normalizeVersion(v) .split('.') diff --git a/util/versions.py b/util/versions.py index 5798761ad..5cdc7313f 100755 --- a/util/versions.py +++ b/util/versions.py @@ -12,6 +12,8 @@ def key(v): return float('inf') if v == 'stable': return sys.maxsize + if v == 'beta': + return sys.maxsize - 1 v = v.replace('v', '').replace('rust-', '')