Docker build #675
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub CD | |
on: | |
push: | |
branches: | |
- main | |
- maven | |
tags: | |
- trellis-[0-9]+.[0-9]+.[0-9]+ | |
jobs: | |
build: | |
name: Java 11 environment | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 11 | |
cache: 'maven' | |
- name: Build with Maven | |
run: ./mvnw verify javadoc:javadoc | |
sonatype: | |
name: Deploy artifacts to Sonatype | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 11 | |
cache: "maven" | |
- name: Publish to Sonatype | |
run: if [[ $(./gradlew -q getVersion) == *SNAPSHOT* ]]; then ./gradlew publish ; fi | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
dockerhub: | |
name: Deploy Docker containers to DockerHub | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
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@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
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@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 11 | |
- name: Build API documentation | |
run: | | |
./gradlew apidocs | |
mkdir -p docs/trellis/$(./gradlew -q getVersion) | |
mv docs/apidocs/$(./gradlew -q getVersion) docs/trellis/$(./gradlew -q getVersion)/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" | |