From 9efc5d287047015283d60691d8142f410a817c67 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 22 Dec 2023 15:26:11 -0500 Subject: [PATCH] Use docs workflow from common Spring IO repo --- .github/workflows/deploy-docs.yml | 49 ++++++++----------------------- 1 file changed, 12 insertions(+), 37 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 146f853403..52097c1298 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -8,43 +8,18 @@ on: required: false push: branches: docs-build -env: - GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} -permissions: read-all + jobs: build: if: github.repository_owner == 'spring-projects' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 5 - - name: Set Up Gradle - uses: spring-io/spring-gradle-build-action@v2 - with: - java-version: '17' - distribution: temurin - - name: Set up refname build - if: github.event.inputs.build-refname - run: | - git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY ${{ github.event.inputs.build-refname }} - echo BUILD_REFNAME=${{ github.event.inputs.build-refname }} >> $GITHUB_ENV - echo BUILD_VERSION=$(git cat-file --textconv FETCH_HEAD:gradle.properties | sed -n '/^version=/ { s/^version=//;p }') >> $GITHUB_ENV - - name: Run Antora - run: ./gradlew antora - - name: Copy the cache to be included in the site - run: cp -rf build/antora/inject-collector-cache-config-extension/.cache build/site/ - - name: Publish Docs - uses: spring-io/spring-doc-actions/rsync-antora-reference@v0.0.11 - with: - docs-username: ${{ secrets.DOCS_USERNAME }} - docs-host: ${{ secrets.DOCS_HOST }} - docs-ssh-key: ${{ secrets.DOCS_SSH_KEY }} - docs-ssh-host-key: ${{ secrets.DOCS_SSH_HOST_KEY }} - - name: Bust Clouflare Cache - uses: spring-io/spring-doc-actions/bust-cloudflare-antora-cache@v0.0.11 - with: - context-root: spring-kafka - cloudflare-zone-id: ${{ secrets.CLOUDFLARE_ZONE_ID }} - cloudflare-cache-token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }} + uses: spring-io/spring-github-workflows/.github/workflows/spring-build-and-deploy-docs.yml@main + with: + build-refname: ${{ inputs.build-refname }} + secrets: + GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} + DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }} + DOCS_HOST: ${{ secrets.DOCS_HOST }} + DOCS_SSH_KEY: ${{ secrets.DOCS_SSH_KEY }} + DOCS_SSH_HOST_KEY: ${{ secrets.DOCS_SSH_HOST_KEY }} + CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} + CLOUDFLARE_CACHE_TOKEN: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}