mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-24 16:55:50 +00:00
chore: test ci (#2)
This commit is contained in:
parent
507aa900c3
commit
aaac2cc11a
4 changed files with 21 additions and 11 deletions
9
.github/workflows/docker-publish.yml
vendored
9
.github/workflows/docker-publish.yml
vendored
|
@ -4,6 +4,9 @@ on:
|
||||||
push:
|
push:
|
||||||
branches: [ development, release-* ]
|
branches: [ development, release-* ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_and_publish:
|
build_and_publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -54,15 +57,17 @@ jobs:
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||||
with:
|
with:
|
||||||
images: ghcr.io/${GITHUB_REPOSITORY}
|
images: ghcr.io/${{ env.IMAGE_NAME }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: ghcr.io/${GITHUB_REPOSITORY}:${{ steps.semantic.outputs.release-version }}
|
tags: ghcr.io/${{ env.IMAGE_NAME }}:${{ steps.semantic.outputs.release-version }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
build-args:
|
||||||
|
- VERSION: ${{ steps.semantic.outputs.release-version }}
|
||||||
|
|
||||||
- name: Publish tag
|
- name: Publish tag
|
||||||
uses: actions-ecosystem/action-push-tag@v1
|
uses: actions-ecosystem/action-push-tag@v1
|
||||||
|
|
7
.github/workflows/gradle-build.yml
vendored
7
.github/workflows/gradle-build.yml
vendored
|
@ -4,6 +4,9 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ development, release/** ]
|
branches: [ development, release/** ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
java_build:
|
java_build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -14,7 +17,7 @@ jobs:
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
distribution: 'temirin'
|
distribution: 'temurin'
|
||||||
- name: Test
|
- name: Test
|
||||||
run: ./gradlew test
|
run: ./gradlew test
|
||||||
- name: Build
|
- name: Build
|
||||||
|
@ -31,4 +34,4 @@ jobs:
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: false
|
push: false
|
||||||
tags: ghcr.io/${ GITHUB_REPOSITORY }:test
|
tags: ghcr.io/${{ env.IMAGE_NAME }}:test
|
||||||
|
|
13
Dockerfile
13
Dockerfile
|
@ -1,12 +1,11 @@
|
||||||
ENV WORKDIR /app
|
|
||||||
ENV PORT 8080
|
|
||||||
ENV VERSION undefined
|
|
||||||
|
|
||||||
FROM eclipse-temurin@sha256:039f727ed86402f37524b5d01a129947e2f061d5856901d07d73a454e689bb13 AS builder
|
FROM eclipse-temurin@sha256:039f727ed86402f37524b5d01a129947e2f061d5856901d07d73a454e689bb13 AS builder
|
||||||
WORKDIR $WORKDIR
|
ARG VERSION undefined
|
||||||
|
ENV VERSION=$VERSION
|
||||||
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN ./gradlew build -x test -Pversion=$VERSION
|
RUN ./gradlew build -x test -Pversion=$VERSION
|
||||||
|
|
||||||
FROM eclipse-temurin@sha256:e90e0d654765ab3ae33f5c5155daafa4a907d0d738ce98c3be8f402a8edcee2b
|
FROM eclipse-temurin@sha256:e90e0d654765ab3ae33f5c5155daafa4a907d0d738ce98c3be8f402a8edcee2b
|
||||||
WORKDIR $WORKDIR
|
ENV PORT 8080
|
||||||
COPY --from=builder $APP_HOME/build/libs/*jar .
|
WORKDIR /app
|
||||||
|
COPY --from=builder /app/build/libs/*jar .
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
# Spring PetClinic Sample Application [](https://github.com/spring-projects/spring-petclinic/actions/workflows/maven-build.yml)
|
# Spring PetClinic Sample Application [](https://github.com/spring-projects/spring-petclinic/actions/workflows/maven-build.yml)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[](https://gitpod.io/#https://github.com/spring-projects/spring-petclinic) [](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=7517918)
|
[](https://gitpod.io/#https://github.com/spring-projects/spring-petclinic) [](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=7517918)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue