From b99ef7b1e4b5dde255c6eb955a63d0cc0fb09760 Mon Sep 17 00:00:00 2001 From: Abel Salgado Romero Date: Mon, 19 Feb 2024 19:42:15 +0100 Subject: [PATCH] Update rules to detect CI run to publish docs (#717) --- .github/workflows/push-documentation.yml | 2 ++ docs/antora/build.gradle | 4 ++-- docs/gh-pages/build.gradle | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push-documentation.yml b/.github/workflows/push-documentation.yml index f8a6652ca..56831a966 100644 --- a/.github/workflows/push-documentation.yml +++ b/.github/workflows/push-documentation.yml @@ -21,6 +21,8 @@ jobs: cd docs ./gradlew --console=plain -q combineDocs - name: Publish documentation + env: + CI_BRANCH: ${{ github.ref_name }} run: | cd docs ./gradlew --console=plain --info :antora:publishDocs :gh-pages:publishDocs \ diff --git a/docs/antora/build.gradle b/docs/antora/build.gradle index 71c92dcfa..344af7290 100644 --- a/docs/antora/build.gradle +++ b/docs/antora/build.gradle @@ -3,7 +3,7 @@ plugins { } ext { - currentBranch = System.getenv('TRAVIS_BRANCH') ?: 'not-on-travis-ci' + currentBranch = System.getenv('CI_BRANCH') ?: 'not-on-ci' pushDocs = currentBranch.matches(~/^(master|development-3.x|maintenance-1.5|maintenance-1.6)$/) } @@ -36,7 +36,7 @@ gitPublish { } task publishDocs { - if(pushDocs) { + if (pushDocs) { dependsOn gitPublishPush } doFirst { diff --git a/docs/gh-pages/build.gradle b/docs/gh-pages/build.gradle index 0b23b76ce..a99c14873 100644 --- a/docs/gh-pages/build.gradle +++ b/docs/gh-pages/build.gradle @@ -3,7 +3,7 @@ plugins { } ext { - currentBranch = System.getenv('TRAVIS_BRANCH') ?: 'not-on-travis-ci' + currentBranch = System.getenv('CI_BRANCH') ?: 'not-on-ci' pushDocs = currentBranch.matches(~/^master|development-.+|maintenance-.+$/) } @@ -25,7 +25,7 @@ gitPublish { } task publishDocs { - if(pushDocs) { + if (pushDocs) { dependsOn gitPublishPush } doFirst {