diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 38f7f996d..75f3b1a6a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,8 +2,6 @@ name: Docs on: push: - branches: - - master tags: - "*" @@ -31,8 +29,7 @@ jobs: echo "BRANCH_NAME=docs/v${{ steps.semver.outputs.major }}.${{ steps.semver.outputs.minor }}" >> $GITHUB_ENV - name: Set branch name for Prerelease if: ${{ steps.semver.outputs.prerelease != '' }} - # Cover all prereleases in one single rc branch. Administrators should manually delete the docs/vX.Y-rc branches from time to time for cleanup rc releases. - run: echo "BRANCH_NAME=docs/v${{ env.MINOR_VERSION}}-rc" >> $GITHUB_ENV + run: echo "BRANCH_NAME=${{ env.BRANCH_NAME }}-rc" >> $GITHUB_ENV - name: Checkout remote branch if exists run: git checkout ${{ env.BRANCH_NAME }} @@ -52,7 +49,12 @@ jobs: if: ${{ steps.semver.outputs.prerelease != '' }} - name: Commit - run: git commit -all --message "Update version for Antora" --author "Antora via GitHub Actions " + run: git commit -all --message "Update version for Antora" continue-on-error: true - name: Push run: git push --atomic --force --set-upstream origin ${{ env.BRANCH_NAME }} + + - name: Cleanup prerelease branch if existing + if: ${{ steps.semver.outputs.prerelease == '' }} + run: git push origin --delete ${{ env.BRANCH_NAME }}-rc + continue-on-error: true