Skip to content

Commit

Permalink
♻️ ::
Browse files Browse the repository at this point in the history
  • Loading branch information
gurdl0525 committed Oct 18, 2023
1 parent e37766b commit fd98647
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/ecr-push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Push to ECR
name: CD

on:
push:
Expand All @@ -9,8 +9,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Build with Gradle
run: ./gradlew bootJar

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -24,9 +32,12 @@ jobs:
uses: aws-actions/amazon-ecr-login@v2

- name: Build, tag, and push image to Amazon ECR
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.login-ecr.outputs.registry }}/highthon-backoffice-server:latest
file: ./Dockerfile
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: oms-organization
IMAGE_TAG: latest
run: |
docker buildx build --platform=linux/amd64 -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
2 changes: 0 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Java CI with Gradle

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM openjdk:17-jdk as builder
ARG JAR_FILE=build/libs/**.jar
ARG JAR_FILE=build/libs/*.jar
ADD ${JAR_FILE} app.jar

FROM openjdk:17-jdk-slim
Expand Down

0 comments on commit fd98647

Please sign in to comment.