upload-docs.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. jobs:
  14. build:
  15. runs-on: ubuntu-20.04
  16. steps:
  17. - uses: actions/checkout@v2
  18. - name: Set up JDK 1.8
  19. uses: actions/setup-java@v1
  20. with:
  21. java-version: 1.8
  22. - uses: actions/cache@v1
  23. with:
  24. path: ~/.m2/repository
  25. key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
  26. restore-keys: |
  27. ${{ runner.os }}-maven-
  28. - name: Build docs
  29. run: ./mvnw clean package javadoc:aggregate -Pdocs,spring -DskipTests=true -e
  30. - name: Upload to S3
  31. env:
  32. AWS_ACCESS_KEY_ID: ${{ secrets.S3_AWS_ACCESS_KEY }}
  33. AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_AWS_SECRET_KEY }}
  34. run: |
  35. aws s3 sync --acl public-read docs/target/generated-docs/ s3://awspring-docs/spring-cloud-aws/docs/
  36. aws s3 sync --acl public-read target/site/ s3://awspring-docs/spring-cloud-aws/docs/
  37. aws cloudfront create-invalidation --distribution-id EA7LER7CI960A --paths "/*"