antora-generate.yml 1.4 KB

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