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