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. jobs:
  11. build:
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Checkout Source
  15. uses: actions/checkout@v2
  16. - name: Set up JDK
  17. uses: actions/setup-java@v1
  18. with:
  19. java-version: '11'
  20. - name: Setup Gradle
  21. uses: gradle/gradle-build-action@v2
  22. env:
  23. GRADLE_USER_HOME: ~/.gradle
  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"