upload-docs.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Build and upload docs
  2. on:
  3. push:
  4. branches:
  5. - main
  6. - 3.0.x
  7. - 2.4.x
  8. - 2.3.x
  9. - 2.2.x
  10. env:
  11. # https://github.com/actions/checkout/issues/440#issuecomment-854240996
  12. AWS_EC2_METADATA_DISABLED: true
  13. permissions:
  14. contents: read
  15. jobs:
  16. build:
  17. runs-on: ubuntu-22.04
  18. steps:
  19. - uses: actions/checkout@v2
  20. - name: Set up JDK 1.8
  21. uses: sdkman/sdkman-action@master
  22. id: sdkman
  23. with:
  24. candidate: java
  25. version: '17.0.1-tem'
  26. - name: Set up 8.0.332-tem
  27. uses: actions/setup-java@v1
  28. with:
  29. java-version: 8
  30. jdkFile: ${{ steps.sdkman.outputs.file }}
  31. - uses: actions/cache@v1
  32. with:
  33. path: ~/.m2/repository
  34. key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
  35. restore-keys: |
  36. ${{ runner.os }}-maven-
  37. - name: Build docs
  38. run: ./mvnw clean package javadoc:aggregate -Pdocs-classic,spring -DskipTests=true -e
  39. - name: Upload to S3
  40. env:
  41. AWS_ACCESS_KEY_ID: ${{ secrets.S3_AWS_ACCESS_KEY }}
  42. AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_AWS_SECRET_KEY }}
  43. run: |
  44. aws s3 sync --acl public-read docs/target/generated-docs/ s3://awspring-docs/spring-cloud-aws/docs/
  45. aws s3 sync --acl public-read target/site/ s3://awspring-docs/spring-cloud-aws/docs/
  46. aws cloudfront create-invalidation --distribution-id EA7LER7CI960A --paths "/*"