-
Notifications
You must be signed in to change notification settings - Fork 21
123 lines (106 loc) · 3.35 KB
/
cd-config.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: GitHub CD
on:
push:
branches:
- main
tags:
- trellis-[0-9]+.[0-9]+.[0-9]+
jobs:
build:
name: Java 11 environment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
cache: 'maven'
- name: Build with Maven
run: ./mvnw -B -ntp verify javadoc:javadoc
- name: Publish to SonarCloud
if: ${{ github.actor != 'dependabot[bot]' }}
continue-on-error: true
run: ./mvnw -B -ntp sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }}
sonatype:
name: Deploy artifacts to Sonatype
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
cache: "maven"
server-id: 'ossrh'
server-username: MAVEN_REPO_USERNAME
server-password: MAVEN_REPO_TOKEN
- name: Publish to Sonatype
run: ./mvnw -B -ntp deploy -Ppublish
env:
MAVEN_REPO_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_REPO_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
dockerhub:
name: Deploy Docker containers to DockerHub
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
cache: "maven"
- name: Publish Docker Containers
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
./buildtools/src/main/resources/docker/publishToDockerHub.sh
docker:
needs: [build]
runs-on: ubuntu-latest
name: Deploy Docker containers to GitHub
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: Publish Docker Containers
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin
./buildtools/src/main/resources/docker/publishToGitHub.sh
javadocs:
name: Deploy javadocs to AWS
needs: [build]
runs-on: ubuntu-latest
if: contains(github.ref, 'trellis')
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: Build API documentation
run: |
./mvnw -B -ntp clean verify site site:stage
mkdir -p docs/trellis/$(./mvnw -q help:evaluate -Dexpression=project.version -DforceStdout)
mv target/staging/apidocs docs/trellis/$(./mvnw -q help:evaluate -Dexpression=project.version -DforceStdout)/apidocs
- name: Sync to AWS S3
uses: jakejarvis/[email protected]
with:
args: --acl public-read
env:
AWS_S3_BUCKET: ${{ secrets.AWS_DOCS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SOURCE_DIR: "docs/trellis"
DEST_DIR: "docs/trellis"