-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
221 changed files
with
4,042 additions
and
3,062 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
push: | ||
branches: | ||
- develop | ||
- main | ||
paths-ignore: | ||
- 'README.md' | ||
- 'LICENSE' | ||
|
@@ -34,7 +35,105 @@ jobs: | |
- name: Push Docker image | ||
run: docker push ${{ secrets.DOCKER_IMAGE_NAME }}:latest | ||
|
||
deploy: | ||
build-notify-slack: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Slack Notification | ||
id: slack-notification | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"channel": "${{ secrets.SLACK_BACKEND_CHANNEL_ID }}", | ||
"attachments": [ | ||
{ | ||
"color": "${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#ff0000' || '#fffff' }}", | ||
"title": "${{ github.repository }}", | ||
"title_link": "https://github.com/${{ github.repository }}", | ||
"text": "${{ job.status == 'success' && 'GitHub Action Build 성공' || job.status == 'failure' && 'GitHub Action Build 실패 :x:' || '' }}", | ||
"fields": [ | ||
{ | ||
"title": "Repository", | ||
"value": "${{ github.repository }}", | ||
"short": true | ||
}, | ||
{ | ||
"title": "Tag", | ||
"value": "${{ github.ref_name }}", | ||
"short": true | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.DEV_DEPLOY_SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
|
||
deploy-develop: | ||
if: github.ref == 'refs/heads/develop' | ||
needs: build | ||
runs-on: [self-hosted, development] # runner로 ec2 연결 | ||
|
||
steps: | ||
- name: Login to Docker Hub #docker hub 로그인 | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Docker run | ||
run: | | ||
docker stop ${{ secrets.DOCKER_CONTAINER_NAME }} | ||
docker rm ${{ secrets.DOCKER_CONTAINER_NAME }} | ||
docker rmi ${{ secrets.DOCKER_IMAGE_NAME }}:latest | ||
docker pull ${{ secrets.DOCKER_IMAGE_NAME }}:latest | ||
- name: Restart the specific service in Docker Compose | ||
run: | | ||
docker-compose up -d ${{ secrets.DOCKER_SERVICES_NAME }} | ||
deploy-notify-slack-develop: | ||
needs: deploy-develop | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Slack Notification | ||
id: slack-notification | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"channel": "${{ secrets.SLACK_BACKEND_CHANNEL_ID }}", | ||
"attachments": [ | ||
{ | ||
"color": "${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#ff0000' || '#fffff' }}", | ||
"title": "${{ github.repository }}", | ||
"title_link": "https://github.com/${{ github.repository }}", | ||
"text": "${{ job.status == 'success' && 'GitHub Action Develop Deploy 성공' || job.status == 'failure' && 'GitHub Action Develop Deploy 실패 :x:' || '' }}", | ||
"fields": [ | ||
{ | ||
"title": "Repository", | ||
"value": "${{ github.repository }}", | ||
"short": true | ||
}, | ||
{ | ||
"title": "Tag", | ||
"value": "${{ github.ref_name }}", | ||
"short": true | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.DEV_DEPLOY_SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
|
||
deploy-main: | ||
if: github.ref == 'refs/heads/main' | ||
needs: build | ||
runs-on: self-hosted # runner로 ec2 연결 | ||
|
||
|
@@ -55,3 +154,41 @@ jobs: | |
- name: Restart the specific service in Docker Compose | ||
run: | | ||
docker-compose up -d ${{ secrets.DOCKER_SERVICES_NAME }} | ||
deploy-notify-slack-main: | ||
needs: deploy-main | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Slack Notification | ||
id: slack-notification | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"channel": "${{ secrets.SLACK_BACKEND_CHANNEL_ID }}", | ||
"attachments": [ | ||
{ | ||
"color": "${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#ff0000' || '#fffff' }}", | ||
"title": "${{ github.repository }}", | ||
"title_link": "https://github.com/${{ github.repository }}", | ||
"text": "${{ job.status == 'success' && 'GitHub Action Main Deploy 성공' || job.status == 'failure' && 'GitHub Action Main Deploy 실패 :x:' || '' }}", | ||
"fields": [ | ||
{ | ||
"title": "Repository", | ||
"value": "${{ github.repository }}", | ||
"short": true | ||
}, | ||
{ | ||
"title": "Tag", | ||
"value": "${{ github.ref_name }}", | ||
"short": true | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.DEV_DEPLOY_SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const BANNED_USER_REASON_LENGTH = { | ||
MIN: 1, | ||
MAX: 255, | ||
MAX: 200, | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.