antora-generate.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. steps:
  16. - name: Checkout Source
  17. uses: actions/checkout@v2
  18. - name: Set up gradle
  19. uses: spring-io/spring-gradle-build-action@v1
  20. with:
  21. java-version: '17'
  22. distribution: 'temurin'
  23. - name: Generate antora.yml
  24. run: ./gradlew :spring-security-docs:generateAntora
  25. - name: Extract Branch Name
  26. id: extract_branch_name
  27. run: echo "##[set-output name=generated_branch_name;]$(echo ${GITHUB_REPOSITORY}/${GITHUB_REF##*/})"
  28. - name: Push generated antora files to the spring-generated-docs
  29. uses: JamesIves/github-pages-deploy-action@4.1.4
  30. with:
  31. branch: ${{ steps.extract_branch_name.outputs.generated_branch_name }} # The branch the action should deploy to.
  32. folder: "docs/build/generateAntora" # The folder the action should deploy.
  33. repository-name: "spring-io/spring-generated-docs"
  34. token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
  35. - name: Dispatch Build Request
  36. run: ${GITHUB_WORKSPACE}/.github/actions/dispatch.sh 'spring-projects/spring-security' "$GH_ACTIONS_REPO_TOKEN"