-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Rewrite workflows with reusable workflows - Rename compose files to compose.yml
- Loading branch information
Showing
36 changed files
with
430 additions
and
162 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Build and deploy OCI image to registry | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
image-jvm-type: | ||
description: JVM type for output image | ||
type: string | ||
default: jre | ||
image-jvm-version: | ||
description: JVM version for output image | ||
type: string | ||
default: 17 | ||
image-name: | ||
description: The output image name | ||
type: string | ||
required: true | ||
java-build-distribution: | ||
description: Java distribution to use for build | ||
type: string | ||
default: temurin | ||
java-build-version: | ||
description: Java version to build with | ||
type: string | ||
default: 17 | ||
registry: | ||
description: The registry to deploy to | ||
type: string | ||
required: true | ||
tags: | ||
description: Comma separated list of docker tags to create | ||
type: string | ||
|
||
jobs: | ||
generate-jvm-tag: | ||
uses: ./.github/workflows/generate-jvm-tag.yml | ||
with: | ||
jvm-type: ${{ inputs.jvm-type }} | ||
jvm-version: ${{ inputs.jvm-version }} | ||
|
||
build-and-push: | ||
name: Build and deploy Java ${{ needs.generate-jvm-tag.outputs.jvm-tag }} OCI image to registry | ||
needs: generate-jvm-tag | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK ${{ inputs.java-build-version }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ inputs.java-build-distribution }} | ||
java-version: ${{ inputs.java-build-version }} | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Add tags environment variable | ||
if: inputs.tags != '' | ||
run: echo "TAGS=-PdockerTags=${{ inputs.tags }}" >> $GITHUB_ENV | ||
|
||
- name: Setup Docker Hub credentials | ||
if: inputs.registry == 'docker.io' | ||
run: | | ||
echo "DOCKER_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}" >> $GITHUB_ENV | ||
echo "DOCKER_PASSWORD=${{ secrets.DOCKERHUB_TOKEN }}" >> $GITHUB_ENV | ||
- name: Setup GitHub Container Registry credentials | ||
if: inputs.registry == 'ghcr.io' | ||
run: | | ||
echo "DOCKER_USERNAME=${{ github.actor }}" >> $GITHUB_ENV | ||
echo "DOCKER_PASSWORD=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | ||
- name: Build and deploy OCI image | ||
run: > | ||
./gradlew bootBuildImage | ||
-PjvmType=${{ inputs.image-jvm-type }} | ||
-PjdkVersion=${{ inputs.image-jvm-version }} | ||
-PdockerUsername=${{ env.DOCKER_USERNAME }} | ||
-PdockerPassword=${{ env.DOCKER_PASSWORD }} | ||
$TAGS | ||
--imageName=${{ inputs.registry }}/${{ inputs.image-name }} | ||
--publishImage |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Find build and latest versions of cloud config | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
distribution: | ||
description: JVM distribution to run | ||
type: string | ||
default: temurin | ||
java-version: | ||
description: JVM version to run | ||
type: string | ||
default: 17 | ||
outputs: | ||
build: | ||
description: Current build version of cloud config | ||
value: ${{ jobs.cloud-config-versions.outputs.build }} | ||
latest: | ||
description: Latest version of cloud config | ||
value: ${{ jobs.cloud-config-versions.outputs.latest }} | ||
|
||
jobs: | ||
cloud-config-versions: | ||
name: Create Cloud Config Versions | ||
runs-on: ubuntu-latest | ||
outputs: | ||
build: ${{ steps.vars.outputs.build }} | ||
latest: ${{ steps.vars.outputs.latest }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK ${{ inputs.java-version }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ inputs.distribution }} | ||
java-version: ${{ inputs.java-version }} | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Set cloud config versions | ||
id: vars | ||
run: | | ||
echo "latest=`curl -s https://search.maven.org/solrsearch/select\?q\=g:%22org.springframework.cloud%22%20AND%20a:%22spring-cloud-config-server%22 | jq -r '.response.docs[0].latestVersion'`" >> $GITHUB_OUTPUT | ||
echo "build=`./gradlew dependencyInsight --dependency org.springframework.cloud:spring-cloud-config-server | grep 'org.springframework.cloud:spring-cloud-config-server:' | tail -1 | cut -d ':' -f 3-`" >> $GITHUB_OUTPUT |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Create sha docker tag | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
jvm-type: | ||
description: JVM type for output image | ||
type: string | ||
default: jre | ||
jvm-version: | ||
description: JVM version for output image | ||
type: string | ||
default: 17 | ||
outputs: | ||
tag: | ||
description: Docker tag with sha of commit | ||
value: ${{ jobs.create-sha-docker-tag.outputs.tag }} | ||
|
||
jobs: | ||
jvm-tag: | ||
uses: ./.github/workflows/generate-jvm-tag.yml | ||
with: | ||
jvm-type: ${{ inputs.jvm-type }} | ||
jvm-version: ${{ inputs.jvm-version }} | ||
|
||
create-sha-docker-tag: | ||
name: Create sha docker tag | ||
needs: jvm-tag | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag: ${{ steps.vars.outputs.tag }} | ||
steps: | ||
- name: Build sha docker tag | ||
id: vars | ||
run: echo "tag=`echo $GITHUB_SHA | cut -c1-7`-${{ needs.jvm-tag.outputs.jvm-tag }}" >> $GITHUB_OUTPUT |
Oops, something went wrong.