upload-docs.yml 1.4 KB

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