-
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.
Merge remote-tracking branch 'origin/master' into prod
- Loading branch information
Showing
2 changed files
with
101 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
name: 개발 관련 | ||
about: 새로운 기능을 개발할 때 사용해주세요! | ||
title: "[FEAT][Domain]" | ||
labels: features | ||
assignees: '' | ||
|
||
--- | ||
|
||
<!-- | ||
제목 예시 : [FEAT][Account] 회원 정보 관리 기능 개발 | ||
--> | ||
## 기능에 대한 설명 | ||
<!-- | ||
왜 이 기능이 필요한지, | ||
구현할 내용에는 어떤 기능들이 포함되어 있는지 자세하게 작성 | ||
--> | ||
- 기능에 대한 필요성을 작성 | ||
1. 기능1 | ||
2. 기능2 | ||
3. ... | ||
|
||
## 기능 구현 마감일 | ||
- 2022년 8월 30일까지 개발을 마칩니다. |
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | ||
|
||
name: CI/CD | ||
|
||
on: | ||
push: | ||
branches: [ "prod" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
CI-CD: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
|
||
## gradle caching | ||
- name: Gradle Caching | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
## docker build & push to production | ||
- name: Docker build & push to prod | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker build -f Dockerfile-prod -t ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }} . | ||
docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }} | ||
## deploy to production | ||
- name: Deploy to prod | ||
uses: appleboy/ssh-action@master | ||
id: deploy-prod | ||
with: | ||
host: ${{ secrets.EC2_HOST }} | ||
username: ec2-user | ||
key: ${{ secrets.EC2_PRIVATE_KEY }} | ||
envs: GITHUB_SHA | ||
script: | | ||
sudo docker rm -f $(docker ps -qa) | ||
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }} | ||
docker-compose up -d | ||
docker image prune -f | ||
## time | ||
current-time: | ||
needs: CI-CD | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get Current Time | ||
uses: 1466587594/get-current-time@v2 | ||
id: current-time | ||
with: | ||
format: YYYY-MM-DDTHH:mm:ss | ||
utcOffset: "+09:00" # 기준이 UTC이기 때문에 한국시간인 KST를 맞추기 위해 +9시간 추가 | ||
|
||
- name: Print Current Time | ||
run: echo "Current Time=${{steps.current-time.outputs.formattedTime}}" # current-time 에서 지정한 포맷대로 현재 시간 출력 | ||
shell: bash |