mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-05-24 03:59:38 +00:00
adding workflow for mr
This commit is contained in:
parent
2ad64f97c7
commit
c2762418ab
2 changed files with 53 additions and 16 deletions
36
.github/workflows/build.yml
vendored
Normal file
36
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
name: Maven github actions CI/CD for merge
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
types: [closed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
my-action:
|
||||||
|
if: ${{ github.event.pull_request.merged }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: ${{ vars.AWS_REGION }}
|
||||||
|
|
||||||
|
- name: Login to Amazon ECR
|
||||||
|
id: login-ecr
|
||||||
|
uses: aws-actions/amazon-ecr-login@v2
|
||||||
|
- name: Build, tag, and push docker image to Amazon ECR
|
||||||
|
env:
|
||||||
|
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
||||||
|
REPOSITORY: my-ecr-repo
|
||||||
|
IMAGE_TAG: ${{ github.sha }}
|
||||||
|
run: |
|
||||||
|
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
|
||||||
|
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
|
||||||
|
|
33
pom.xml
33
pom.xml
|
@ -5,22 +5,12 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.4.0</version>
|
<version>3.2.0</version>
|
||||||
<relativePath />
|
<relativePath />
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<distributionManagement>
|
|
||||||
<snapshotRepository>
|
|
||||||
<id>nexus-snapshots</id>
|
|
||||||
<url>http://localhost:8081/repository/maven-snapshots/</url>
|
|
||||||
</snapshotRepository>
|
|
||||||
<repository>
|
|
||||||
<id>nexus-releases</id>
|
|
||||||
<url>http://localhost:8081/repository/maven-releases/</url>
|
|
||||||
</repository>
|
|
||||||
</distributionManagement>
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:git:git@github.com:Piasecki-grid/maven-project.git</connection>
|
<connection>scm:git:git@github.com:Piasecki-grid/maven-project.git</connection>
|
||||||
<developerConnection>scm:git:git@github.com:Piasecki-grid/maven-project.git</developerConnection>
|
<developerConnection>scm:git:git@github.com:Piasecki-grid/maven-project.git</developerConnection>
|
||||||
|
@ -57,7 +47,22 @@
|
||||||
<spring-format.version>0.0.43</spring-format.version>
|
<spring-format.version>0.0.43</spring-format.version>
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
|
<reporting>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
|
<version>3.6.0</version>
|
||||||
|
<reportSets>
|
||||||
|
<reportSet>
|
||||||
|
<reports>
|
||||||
|
<report>checkstyle</report>
|
||||||
|
</reports>
|
||||||
|
</reportSet>
|
||||||
|
</reportSets>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</reporting>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- Spring and Spring Boot dependencies -->
|
<!-- Spring and Spring Boot dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -340,10 +345,6 @@
|
||||||
</licenses>
|
</licenses>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
|
||||||
<id>maven-group</id>
|
|
||||||
<url>http://localhost:8081/repository/maven-central/</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<repository>
|
<repository>
|
||||||
<snapshots>
|
<snapshots>
|
||||||
|
|
Loading…
Reference in a new issue