deploy-docs.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Deploy Docs
  2. run-name: ${{ format('{0} ({1})', github.workflow, github.event.inputs.build-refname || 'all') }}
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. build-refname:
  7. description: Enter git refname to build (e.g., 5.7.x).
  8. required: false
  9. push:
  10. branches: docs-build
  11. env:
  12. GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
  13. permissions:
  14. contents: write
  15. jobs:
  16. build:
  17. # if: github.repository_owner == 'spring-projects'
  18. runs-on: ubuntu-latest
  19. steps:
  20. - name: Checkout
  21. uses: actions/checkout@v3
  22. with:
  23. fetch-depth: 5
  24. - name: Set Up Gradle
  25. uses: spring-io/spring-gradle-build-action@v2
  26. with:
  27. java-version: '17'
  28. distribution: temurin
  29. - name: Set up refname build
  30. if: github.event.inputs.build-refname
  31. run: |
  32. git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY ${{ github.event.inputs.build-refname }}
  33. echo BUILD_REFNAME=${{ github.event.inputs.build-refname }} >> $GITHUB_ENV
  34. echo BUILD_VERSION=$(git cat-file --textconv FETCH_HEAD:gradle.properties | sed -n '/^version=/ { s/^version=//;p }') >> $GITHUB_ENV
  35. - name: Run Antora
  36. run: ./gradlew antora
  37. - name: Publish Docs
  38. uses: JamesIves/github-pages-deploy-action@v4
  39. with:
  40. folder: build/site # The folder the action should deploy.
  41. # - name: Copy the cache to be included in the site
  42. # run: cp -rf build/antora/inject-collector-cache-config-extension/.cache build/site/
  43. # - name: Publish Docs
  44. # uses: spring-io/spring-doc-actions/rsync-antora-reference@v0.0.11
  45. # with:
  46. # docs-username: ${{ secrets.DOCS_USERNAME }}
  47. # docs-host: ${{ secrets.DOCS_HOST }}
  48. # docs-ssh-key: ${{ secrets.DOCS_SSH_KEY }}
  49. # docs-ssh-host-key: ${{ secrets.DOCS_SSH_HOST_KEY }}
  50. # - name: Bust Clouflare Cache
  51. # uses: spring-io/spring-doc-actions/bust-cloudflare-antora-cache@v0.0.11
  52. # with:
  53. # context-root: spring-security
  54. # cloudflare-zone-id: ${{ secrets.CLOUDFLARE_ZONE_ID }}
  55. # cloudflare-cache-token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}