Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/release-drafter-pre-processing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name-template: 'pre-processing-v$RESOLVED_VERSION'
tag-template: 'pre-processing-v$RESOLVED_VERSION'
categories:
- title: 'Feature'
labels:
- 'enhancement'
- 'pre-processing'
- title: 'Bug Fixes'
labels:
- 'bug'
- 'pre-processing'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
- 'pre-processing'
minor:
labels:
- 'minor'
- 'pre-processing'
patch:
labels:
- 'patch'
- 'pre-processing'
default: patch
template: |
## Changes
$CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
name-template: 'user-service-v$RESOLVED_VERSION'
tag-template: 'user-service-v$RESOLVED_VERSION'
categories:
- title: 'Feature'
labels:
Expand Down
27 changes: 25 additions & 2 deletions .github/workflows/deploy-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Create env file
run: |
echo "DB_HOST=${{ secrets.DB_HOST }}" > .env.prod
echo "DB_PORT=${{ secrets.DB_PORT }}" >> .env.prod
echo "DB_USER=${{ secrets.DB_USER }}" >> .env.prod
echo "DB_PASS=${{ secrets.DB_PASS }}" >> .env.prod
echo "DB_NAME=${{ secrets.DB_NAME }}" >> .env.prod
echo "ENV_NAME=${{ secrets.ENV_NAME }}" >> .env.prod

- name: Set repo lowercase
run: echo "REPO_LC=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV

Expand All @@ -26,15 +35,29 @@ jobs:
source: "docker/production/docker-compose.yml"
target: "~/app"

- name: Copy .env.prod file to EC2
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.SERVER_HOST }}
username: ubuntu
key: ${{ secrets.SERVER_SSH_KEY }}
source: ".env.prod"
target: "~/app/docker/production/"
overwrite: true

- name: Deploy on EC2
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SERVER_HOST }}
# username: ${{ secrets.SERVER_USER }}
username: ubuntu
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
cd ~/app/docker/production

# Remove existing .env.prod if exists and move new one
rm -f .env.prod
mv .env.prod.bak .env.prod 2>/dev/null || mv .env.prod .env.prod

echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

docker pull ghcr.io/${{ env.REPO_LC }}/user-service:latest
Expand Down Expand Up @@ -71,4 +94,4 @@ jobs:
**Repository:** ${{ env.REPO_LC }}
**Tag:** ${{ github.ref_name }}
**Error:** 배포 중 오류가 발생했습니다.
**Check:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
**Check:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
40 changes: 25 additions & 15 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,41 @@ on:
push:
branches:
- main
paths:
- 'apps/user-service/**'
- 'apps/pre-processing/**'
pull_request:
types: [opened, reopened, synchronize]
paths:
- 'apps/user-service/**'
- 'apps/pre-processing/**'

permissions:
contents: read

jobs:
update_release_draft:
update_user_service_release:
runs-on: ubuntu-latest
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && contains(github.event.head_commit.modified, 'apps/user-service/') || github.event_name == 'pull_request' }}
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
- uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter-user-service.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Drafts your next Release notes as Pull Requests are merged into "main"
update_preprocessing_release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: ${{ github.event_name == 'push' && contains(github.event.head_commit.modified, 'apps/pre-processing/') || github.event_name == 'pull_request' }}
steps:
- uses: release-drafter/release-drafter@v5
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
with:
config-name: release-drafter-pre-processing.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions apps/user-service/src/main/resources/application-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
spring:
config:
activate:
on-profile: production

datasource:
url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/${DB_NAME}
username: ${DB_USER}
password: ${DB_PASS}
driver-class-name: org.mariadb.jdbc.Driver

hikari:
connection-timeout: 30000
idle-timeout: 600000
max-lifetime: 1800000
maximum-pool-size: 10
minimum-idle: 5
pool-name: HikariCP-MyBatis

mybatis:
mapper-locations: classpath:mybatis/mapper/**/*.xml
type-aliases-package: site.icebang.dto
configuration:
map-underscore-to-camel-case: true

logging:
config: classpath:log4j2-production.yml
Loading