antora-generate.yml 1.3 KB

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