Skip to content

Refactor: 멀티모듈 개선 (#473) #222

Refactor: 멀티모듈 개선 (#473)

Refactor: 멀티모듈 개선 (#473) #222

Workflow file for this run

name: Push Image to Amazon ECR
on:
push:
branches:
- dev
env:
AWS_REGION: ap-northeast-2
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
GITHUB_SHA_FIX: ${{ github.sha }}
jobs:
build:
# ubuntu 버전 지정
runs-on: ubuntu-22.04
steps:
# Checkout 진행
- uses: actions/checkout@v3
# JDK 11 설치
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
# Gradle 캐싱
- name: Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# Gradle 권한 부여
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# FCM 서비스 계정 키 적용
- name: Make firebase-service-key.json
run: |
cd ./src/main/resources
mkdir firebase
cd firebase
touch ./firebase-service-key.json
echo "${{ secrets.FIREBASE_RELEASE_ADMIN }}" | openssl base64 -d -A > ./firebase-service-key.json
shell: bash
# secret.yml 반영
- name: Make application-secret.yml
run: |
cd ./src/main/resources
touch ./application-secret.yml
echo "${{ secrets.APPLICATION_SECRET }}" > ./application-secret.yml
shell: bash
# dev.yml 반영
- name: Make application-dev.yml
run: |
cd ./src/main/resources
echo "${{ secrets.APPLICATION_DEV }}" > ./application-release.yml
shell: bash
# Gradle BootJar
- name: BootJar with Gradle
run: ./gradlew clean bootJar -Dspring.profiles.active=dev
# Configure AWS Credentials by using IAM inform
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} # 나의 ECR 정보
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ env.AWS_REGION }}
# Login to ECR
# - name: Login to Amazon ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v1
# Docker Image Push to ECR and Run container with Image pull from ECR
# - name: Build, tag, and push image to Amazon ECR
# id: build-image
# env:
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# IMAGE_TAG: ${{ env.GITHUB_SHA_FIX }}
# run: |
# # Build a docker container and push it to ECR so that it can be deployed to ECS.
# docker build -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"