Skip to content

Commit

Permalink
v1.5.1 (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangwook02 authored Mar 5, 2024
2 parents 19a3ac1 + e462a38 commit 3e11a37
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 36 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/develop_build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and Deploy to Develop

on:
push:
branches: [ "develop" ]
branches: ["develop"]

permissions:
id-token: write
Expand All @@ -17,8 +17,8 @@ jobs:
environment: develop
strategy:
matrix:
java-version: [ 17 ]
distribution: [ 'temurin' ]
java-version: [17]
distribution: ["temurin"]
steps:
# 체크아웃
- name: Checkout
Expand Down Expand Up @@ -103,12 +103,13 @@ jobs:
uses: Ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_EMBEDS: '[
{
"title": "푸드덕푸드덕푸드덕",
"description": "구구구구국 구구...: ${{ steps.gradle.outputs.build-scan-url }}"
}
]'
DISCORD_EMBEDS: |
[
{
"title": "푸드덕푸드덕푸드덕",
"description": "구구구구국 구구...: ${{ steps.gradle.outputs.build-scan-url }}"
}
]
# EC2로 배포
- name: Deploy to EC2 Server
Expand All @@ -120,7 +121,7 @@ jobs:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_PRIVATE_KEY }}
envs: IMAGE_FULL_URL # docker-compose.yml 에서 사용할 환경 변수
envs: IMAGE_FULL_URL # docker-compose.yml 에서 사용할 환경 변수
script: |
aws s3 cp ${{ env.S3_COPY_PATH }} docker-compose.yml
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/develop_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
commit_hash:
description: 'commit_hash'
description: "commit_hash"
required: true

jobs:
Expand All @@ -16,14 +16,14 @@ jobs:
uses: appleboy/ssh-action@master
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_IMAGE_TAG: ${{ github.event.inputs.commit_hash }}
IMAGE_FULL_URL: ${{ secrets.DOCKERHUB_USERNAME }}/gdsc-server:${{ github.event.inputs.commit_hash }}
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_PRIVATE_KEY }}
envs: DOCKERHUB_USERNAME,DOCKERHUB_IMAGE_TAG # docker-compose.yml 에서 사용할 환경 변수
script: |
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker pull ${{ env.DOCKERHUB_USERNAME }}/gdsc-server:${{ env.DOCKERHUB_IMAGE_TAG }}
docker compose -f /home/ubuntu/docker-compose.yml up -d
docker image prune -a -f
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_PRIVATE_KEY }}
envs: IMAGE_FULL_URL # docker-compose.yml 에서 사용할 환경 변수
script: |
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker pull ${{ env.IMAGE_FULL_URL }}
docker compose up -d
docker image prune -a -f
19 changes: 10 additions & 9 deletions .github/workflows/production_build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
environment: production
strategy:
matrix:
java-version: [ 17 ]
distribution: [ 'temurin' ]
java-version: [17]
distribution: ["temurin"]
steps:
# 체크아웃
- name: Checkout
Expand Down Expand Up @@ -119,12 +119,13 @@ jobs:
uses: Ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_EMBEDS: '[
{
"title": "푸드덕푸드덕푸드덕",
"description": "구구구구국 구구...: ${{ steps.gradle.outputs.build-scan-url }}"
}
]'
DISCORD_EMBEDS: |
[
{
"title": "푸드덕푸드덕푸드덕",
"description": "구구구구국 구구...: ${{ steps.gradle.outputs.build-scan-url }}"
}
]
- name: Deploy to EC2 Server
uses: appleboy/ssh-action@master
Expand All @@ -135,7 +136,7 @@ jobs:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_PRIVATE_KEY }}
envs: IMAGE_FULL_URL # docker-compose.yml 에서 사용할 환경 변수
envs: IMAGE_FULL_URL # docker-compose.yml 에서 사용할 환경 변수
script: |
aws s3 cp ${{ env.S3_COPY_PATH }} docker-compose.yml
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/production_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy to Production

on:
workflow_dispatch:
inputs:
semver:
description: "semver without v"
required: true

jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- name: Deploy to EC2 Server
uses: appleboy/ssh-action@master
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
IMAGE_FULL_URL: ${{ secrets.DOCKERHUB_USERNAME }}/gdsc-server:${{ github.event.inputs.semver }}
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USERNAME }}
key: ${{ secrets.EC2_PRIVATE_KEY }}
envs: IMAGE_FULL_URL # docker-compose.yml 에서 사용할 환경 변수
script: |
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
docker pull ${{ env.IMAGE_FULL_URL }}
docker-compose up -d
docker image prune -a -f
4 changes: 2 additions & 2 deletions .github/workflows/pull_request_gradle_build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name : Check Style and Test to Develop
name: Check Style and Test to Develop

on:
pull_request:
branches: [ "develop" ]
branches: ["develop"]

jobs:
build-test:
Expand Down
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jar {

spotless {
format 'misc', {
target '**/*.yml', '**/*.gradle', '**/*.md'
target '**/*.gradle', '**/*.md'
trimTrailingWhitespace()
indentWithSpaces(4)
endWithNewline()
Expand All @@ -102,6 +102,11 @@ spotless {
palantirJavaFormat()
formatAnnotations()
}

yaml {
target '**/*.yml'
prettier()
}
}

tasks.register('updateGitHooks', Copy) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public record MemberUpdateRequest(
String phone,
@NotNull @Schema(description = "학과") Department department,
@NotBlank @Email @Schema(description = "이메일") String email,
@NotBlank @Schema(description = "디스코드 유저네임") String discordUsername,
@NotBlank
@Pattern(regexp = NICKNAME, message = "닉네임은 " + NICKNAME + " 형식이어야 합니다.")
@Schema(description = "디스코드 유저네임") String discordUsername,
@Pattern(regexp = NICKNAME, message = "닉네임은 " + NICKNAME + " 형식이어야 합니다.")
@Schema(description = "커뮤니티 닉네임", pattern = NICKNAME)
String nickname) {}

0 comments on commit 3e11a37

Please sign in to comment.