mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 00:05: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:
|
||||
branches: [ development, release-* ]
|
||||
|
||||
env:
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build_and_publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -54,15 +57,17 @@ jobs:
|
|||
id: meta
|
||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||
with:
|
||||
images: ghcr.io/${GITHUB_REPOSITORY}
|
||||
images: ghcr.io/${{ env.IMAGE_NAME }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||
with:
|
||||
context: .
|
||||
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 }}
|
||||
build-args:
|
||||
- VERSION: ${{ steps.semantic.outputs.release-version }}
|
||||
|
||||
- name: Publish tag
|
||||
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:
|
||||
branches: [ development, release/** ]
|
||||
|
||||
env:
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
java_build:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -14,7 +17,7 @@ jobs:
|
|||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temirin'
|
||||
distribution: 'temurin'
|
||||
- name: Test
|
||||
run: ./gradlew test
|
||||
- name: Build
|
||||
|
@ -31,4 +34,4 @@ jobs:
|
|||
with:
|
||||
context: .
|
||||
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
|
||||
WORKDIR $WORKDIR
|
||||
ARG VERSION undefined
|
||||
ENV VERSION=$VERSION
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN ./gradlew build -x test -Pversion=$VERSION
|
||||
|
||||
FROM eclipse-temurin@sha256:e90e0d654765ab3ae33f5c5155daafa4a907d0d738ce98c3be8f402a8edcee2b
|
||||
WORKDIR $WORKDIR
|
||||
COPY --from=builder $APP_HOME/build/libs/*jar .
|
||||
ENV PORT 8080
|
||||
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)
|
||||
|
||||
|
||||
|
||||
|
||||
[](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