Skip to content

Commit

Permalink
chore: 워크플로우 수정
Browse files Browse the repository at this point in the history
chore: 로그 경로 수정
  • Loading branch information
dooboocookie authored Oct 5, 2023
1 parent 9771e52 commit d77fe7e
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 4 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/backend_prod_merge_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
push:
branches:
- main

paths:
- backend/**

jobs:
deploy:
runs-on: naaga
Expand Down Expand Up @@ -38,3 +40,22 @@ jobs:
cd /home/ubuntu/prod
chmod +x ./deploy_prod.sh
sudo ./deploy_prod.sh
sync-dev_backend:
needs: deploy

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: main

- name: merge main -> dev_backend
uses: devmasx/merge-branch@master
with:
type: now
from_branch: main
target_branch: dev_backend
github_token: ${{ secrets.GITHUB_TOKEN }}
60 changes: 60 additions & 0 deletions .github/workflows/backend_rel_merge_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: NAAGA BACKEND RELEASE SERVER MERGE CI/CD

on:
push:
branches:
- release/**
paths:
- backend/**

jobs:
deploy:
runs-on: naaga
steps:
- name: change permission
run: |
sudo chown -R ubuntu:ubuntu /home/ubuntu/actions-runner/naaga/2023-naaga/2023-naaga
- name: checkout
uses: actions/checkout@v3
with:
submodules: true
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: project remove
run: |
sudo rm -rf /home/ubuntu/prod/2023-naaga
- name: project copy
run: |
sudo cp -r /home/ubuntu/actions-runner/naaga/2023-naaga/2023-naaga /home/ubuntu/prod
- name: build
run: |
cd /home/ubuntu/prod/2023-naaga/backend
sudo chmod +x ./gradlew
sudo ./gradlew clean bootJar
- name: transfer & run
run: |
cd /home/ubuntu/prod
chmod +x ./deploy_prod.sh
sudo ./deploy_prod.sh
sync-dev_backend:
needs: deploy

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: main

- name: merge release -> dev_backend
uses: devmasx/merge-branch@master
with:
type: now
target_branch: dev_backend
github_token: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import jakarta.persistence.ManyToOne;
import java.util.Objects;

// 아직 미구역 영역입니다. 사실 백엔드 디렉토리 변경을 위한 변경사항입니다.
@Entity
public class PlaceLike extends BaseEntity {

Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/resources/error-appender.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<included>
<appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>./logs/error.log</file>
<file>/home/ubuntu/logs/error.log</file>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch> <!-- 해당 레벨만 기록한다. -->
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/resources/info-appender.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<included>
<appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>./logs/info.log</file>
<file>/home/ubuntu/logs/info.log</file>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>INFO</level>
<onMatch>ACCEPT</onMatch>
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/resources/warn-appender.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<included>
<appender name="WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>./logs/warn.log</file>
<file>/home/ubuntu/logs/warn.log</file>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>WARN</level>
<onMatch>ACCEPT</onMatch>
Expand Down

0 comments on commit d77fe7e

Please sign in to comment.