antora-generate.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. name: Generate Antora Files and Request Build
  2. on:
  3. workflow_dispatch:
  4. push:
  5. branches-ignore:
  6. - 'gh-pages'
  7. tags: '**'
  8. env:
  9. GH_ACTIONS_REPO_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
  10. permissions:
  11. contents: read
  12. jobs:
  13. build:
  14. runs-on: ubuntu-latest
  15. if: ${{ github.repository == 'spring-projects/spring-security' }}
  16. steps:
  17. - name: Checkout Source
  18. uses: actions/checkout@v2
  19. - name: Set up gradle
  20. uses: spring-io/spring-gradle-build-action@v1
  21. with:
  22. java-version: '17'
  23. distribution: 'temurin'
  24. - name: Generate antora.yml
  25. run: ./gradlew :spring-security-docs:generateAntora
  26. - name: Extract Branch Name
  27. id: extract_branch_name
  28. run: echo "##[set-output name=generated_branch_name;]$(echo ${GITHUB_REPOSITORY}/${GITHUB_REF##*/})"
  29. - name: Push generated antora files to the spring-generated-docs
  30. uses: JamesIves/github-pages-deploy-action@4.1.4
  31. with:
  32. branch: ${{ steps.extract_branch_name.outputs.generated_branch_name }} # The branch the action should deploy to.
  33. folder: "docs/build/generateAntora" # The folder the action should deploy.
  34. repository-name: "spring-io/spring-generated-docs"
  35. token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
  36. - name: Dispatch Build Request
  37. run: ${GITHUB_WORKSPACE}/.github/actions/dispatch.sh 'spring-projects/spring-security' "$GH_ACTIONS_REPO_TOKEN"