upload-docs.yml 1.2 KB

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