Skip to content

fix: 카프카 오류 수정 #11

fix: 카프카 오류 수정

fix: 카프카 오류 수정 #11

Workflow file for this run

name: Java CI with Gradle
on:
pull_request:
types: [closed]
branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
## create application-prod.yml
- name: make application-prod.yml
run: |
mkdir -p ./src/main/resources
cd ./src/main/resources
touch ./application.yml
echo '${{ secrets.PROPERTIES_PROD }}' > ./application.yml
shell: bash
## grant execute permission for gradlew
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle Wrapper
run: ./gradlew build -x test
## docker build & push to production
- name: Docker build & push to prod
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD}}
docker build -t ${{ secrets.DOCKER_USERNAME }}/payment .
docker push ${{ secrets.DOCKER_USERNAME }}/payment
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
## deploy to production
- name: Deploy to prod
uses: appleboy/ssh-action@master
id: deploy-prod
with:
host: ${{ secrets.HOST_EC2 }} # EC2 퍼블릭 IPv4 DNS
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
envs: GITHUB_SHA
script: |
sudo docker stop mfc-payment
sudo docker rm mfc-payment
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/payment
sudo docker run -d --name mfc-payment --network mfc -P ${{ secrets.DOCKER_USERNAME }}/payment
sudo docker image prune -f