Skip to content

Commit

Permalink
Merge pull request #120 from MaeumgaGym/develop
Browse files Browse the repository at this point in the history
๐Ÿš€ :: 1.2.0 PROD
  • Loading branch information
HyunSu1768 authored Jan 30, 2024
2 parents c23d3ef + c8dc188 commit ad2bd90
Show file tree
Hide file tree
Showing 195 changed files with 2,457 additions and 885 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: xquare-deployment

on:
push:
branches: [ "main" ]

jobs:
build:
permissions:
id-token: write
contents: read

runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: mysql
uses: mirromutth/[email protected]
with:
host port: 3306
container port: 3306
mysql database: 'maeumgagym'
mysql root password: ${{ secrets.TEST_DB_PASSWORD }}

- name: gradle caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts*', '**/gradle-wrapper.properties') }}

- name: Build gradle
run: ./gradlew build
env:
SPRING_PROFILES_ACTIVE: local
DB_URL: ${{ secrets.TEST_DB_URL }}
DB_USERNAME: ${{ secrets.TEST_DB_USERNAME }}
DB_PASSWORD: ${{ secrets.TEST_DB_PASSWORD }}
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
JWT_ACCESS_EXP: ${{ secrets.JWT_ACCESS_EXP }}
JWT_REFRESH_EXP: ${{ secrets.JWT_REFRESH_EXP }}
JWT_HEADER: ${{ secrets.JWT_HEADER }}
JWT_PREFIX: ${{ secrets.JWT_PREFIX }}
GRANT_TYPE: ${{ secrets.GRANT_TYPE }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
REDIS_HOST: ${{ secrets.TEST_REDIS_HOST }}
REDIS_PORT: ${{ secrets.REDIS_PORT }}
FILE_SERVER_SECRET_KEY: ${{ secrets.FILE_SERVER_SECRET_KEY }}
FILE_SERVER_URL: ${{ secrets.FILE_SERVER_URL }}
VIDEO_ID_SAVE_TTL: ${{ secrets.VIDEO_ID_SAVE_TTL }}
SUFFIX_PATH: ${{ secrets.SUFFIX_PATH }}
SWAGGER_PATH: ${{ secrets.SWAGGER_PATH }}
SWAGGER_UI_PATH: ${{ secrets.SWAGGER_UI_PATH }}

- name: Deploy to xquare
uses: team-xquare/xquare-deployment-action@master
with:
environment: prod
access_key: ${{ secrets.ACCESS_KEY }}
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
buildargs: |
PROFILE=prod
DB_URL=${{ secrets.DB_URL }}
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
DB_USERNAME=${{ secrets.DB_USERNAME }}
JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }}
JWT_ACCESS_EXP=${{ secrets.JWT_ACCESS_EXP }}
JWT_REFRESH_EXP=${{ secrets.JWT_REFRESH_EXP }}
JWT_HEADER=${{ secrets.JWT_HEADER }}
JWT_PREFIX=${{ secrets.JWT_PREFIX }}
GRANT_TYPE=${{ secrets.GRANT_TYPE }}
CLIENT_ID=${{ secrets.CLIENT_ID }}
REDIRECT_URI=${{ secrets.REDIRECT_URI }}
REDIS_HOST=${{ secrets.REDIS_HOST }}
REDIS_PORT=${{ secrets.REDIS_PORT }}
FILE_SERVER_SECRET_KEY=${{ secrets.FILE_SERVER_SECRET_KEY }}
FILE_SERVER_URL=${{ secrets.FILE_SERVER_URL }}
VIDEO_ID_SAVE_TTL=${{ secrets.VIDEO_ID_SAVE_TTL }}
SUFFIX_PATH=${{ secrets.SUFFIX_PATH }}
SWAGGER_PATH=${{ secrets.SWAGGER_PATH }}
SWAGGER_UI_PATH=${{ secrets.SWAGGER_UI_PATH }}
FRONT_DOMAIN=${{ secrets.FRONT_DOMAIN }}
BACK_DOMAIN=${{ secrets.BACK_DOMAIN_PROD }}
98 changes: 98 additions & 0 deletions .github/workflows/deploy-stag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: xquare-deployment

on:
push:
branches: [ "develop" ]

jobs:
build:
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: mysql
uses: mirromutth/[email protected]
with:
host port: 3306
container port: 3306
mysql database: 'maeumgagym'
mysql root password: ${{ secrets.TEST_DB_PASSWORD }}

- name: gradle caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts*', '**/gradle-wrapper.properties') }}

- name: Build gradle
run: ./gradlew build
env:
SPRING_PROFILES_ACTIVE: local
DB_URL: ${{ secrets.TEST_DB_URL }}
DB_USERNAME: ${{ secrets.TEST_DB_USERNAME }}
DB_PASSWORD: ${{ secrets.TEST_DB_PASSWORD }}
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
JWT_ACCESS_EXP: ${{ secrets.JWT_ACCESS_EXP }}
JWT_REFRESH_EXP: ${{ secrets.JWT_REFRESH_EXP }}
JWT_HEADER: ${{ secrets.JWT_HEADER }}
JWT_PREFIX: ${{ secrets.JWT_PREFIX }}
GRANT_TYPE: ${{ secrets.GRANT_TYPE }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
REDIS_HOST: ${{ secrets.TEST_REDIS_HOST }}
REDIS_PORT: ${{ secrets.REDIS_PORT }}
FILE_SERVER_SECRET_KEY: ${{ secrets.FILE_SERVER_SECRET_KEY }}
FILE_SERVER_URL: ${{ secrets.FILE_SERVER_URL }}
VIDEO_ID_SAVE_TTL: ${{ secrets.VIDEO_ID_SAVE_TTL }}
SUFFIX_PATH: ${{ secrets.SUFFIX_PATH }}
SWAGGER_PATH: ${{ secrets.SWAGGER_PATH }}
SWAGGER_UI_PATH: ${{ secrets.SWAGGER_UI_PATH }}

- name: Deploy to xquare
uses: team-xquare/xquare-deployment-action@master
with:
environment: stag
access_key: ${{ secrets.ACCESS_KEY }}
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
buildargs: |
PROFILE=stag
DB_URL=${{ secrets.DB_URL }}
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
DB_USERNAME=${{ secrets.DB_USERNAME }}
JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }}
JWT_ACCESS_EXP=${{ secrets.JWT_ACCESS_EXP }}
JWT_REFRESH_EXP=${{ secrets.JWT_REFRESH_EXP }}
JWT_HEADER=${{ secrets.JWT_HEADER }}
JWT_PREFIX=${{ secrets.JWT_PREFIX }}
GRANT_TYPE=${{ secrets.GRANT_TYPE }}
CLIENT_ID=${{ secrets.CLIENT_ID }}
REDIRECT_URI=${{ secrets.REDIRECT_URI }}
REDIS_HOST=${{ secrets.REDIS_HOST }}
REDIS_PORT=${{ secrets.REDIS_PORT }}
FILE_SERVER_SECRET_KEY=${{ secrets.FILE_SERVER_SECRET_KEY }}
FILE_SERVER_URL=${{ secrets.FILE_SERVER_URL }}
VIDEO_ID_SAVE_TTL=${{ secrets.VIDEO_ID_SAVE_TTL }}
SUFFIX_PATH=${{ secrets.SUFFIX_PATH }}
SWAGGER_PATH=${{ secrets.SWAGGER_PATH }}
SWAGGER_UI_PATH=${{ secrets.SWAGGER_UI_PATH }}
FRONT_LOCAL=${{ secrets.FRONT_LOCAL }}
BACK_DOMAIN=${{ secrets.BACK_DOMAIN_STAG }}
55 changes: 27 additions & 28 deletions .github/workflows/klint-check.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
name: ktlint

on:
pull_request:
branches:
- develop
pull_request:
branches:
- develop

jobs:
ktlint:
name: Check Code Quality
runs-on: ubuntu-latest
if: ${{ ! startsWith(github.event.head_commit.message, '!!') }}
ktlint:
name: Check Code Quality
runs-on: ubuntu-latest
if: ${{ ! startsWith(github.event.head_commit.message, '!!') }}

steps:
- name: Clone repo
uses: actions/checkout@v2
with:
fetch-depth: 1
steps:
- name: Clone repo
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Setup JDK
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Setup JDK
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'

- name: gradle caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}

- name: Run ktlint
run: |
./gradlew ktlintCheck --daemon --parallel --configure-on-demand
- name: gradle caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts*', '**/gradle-wrapper.properties') }}

- name: Run ktlint
run: |
./gradlew ktlintCheck --daemon --parallel --configure-on-demand
32 changes: 16 additions & 16 deletions .github/workflows/release-auto.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: release-auto-create

on:
push:
branches: [ "main" ]
push:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: ๋ฒ„์ „ ์ •๋ณด ์ถ”์ถœ
run: echo "##[set-output name=version;]$(echo '${{ github.event.head_commit.message }}' | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
id: extract_version_name
- name: ๋ฒ„์ „ ์ •๋ณด ์ถ”์ถœ
run: echo "##[set-output name=version;]$(echo '${{ github.event.head_commit.message }}' | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')"
id: extract_version_name

- name: Release ์ƒ์„ฑ
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
tag_name: ${{ steps.extract_version_name.outputs.version }}
release_name: ${{ github.event.head_commit.message.title }}
- name: Release ์ƒ์„ฑ
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
tag_name: ${{ steps.extract_version_name.outputs.version }}
release_name: ${{ github.event.head_commit.message.title }}
Loading

0 comments on commit ad2bd90

Please sign in to comment.