Skip to content

Commit afa84de

Browse files
authored
CI / CD 워크플로우 오류를 해결한다. (#54)
* chore: modify PR templates * fix: modify deploy workflow * fix: modify docker-compose file
1 parent 3ce4dd2 commit afa84de

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

.github/ISSUE_TEMPLATE/fix.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
name: "fix"
33
about: 버그 및 에러 이슈 템플릿
44
title: ""
5-
labels: "bug/error"
5+
labels: "fix"
66
assignees: ''
77
---
8+
89
## Description
910
-

.github/ISSUE_TEMPLATE/test.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ jobs:
7777
host: ${{ secrets.EC2_HOST }}
7878
username: ${{ secrets.EC2_USER }}
7979
key: ${{ secrets.EC2_PRIVATE_KEY }}
80-
source: "docker/docker-compose.yml"
80+
source: docker/docker-compose.yml
8181
target: "~"
82+
strip_components: 1
8283
- name: Build and deploy container to AWS EC2
8384
uses: appleboy/[email protected]
8485
with:
@@ -87,14 +88,19 @@ jobs:
8788
key: ${{ secrets.EC2_PRIVATE_KEY }}
8889
script: |
8990
aws secretsmanager get-secret-value --secret-id ${{ github.ref_name }}-env --region ap-northeast-2 --query SecretString --output text | jq -r '. | to_entries | map("\(.key)=\(.value)") | .[]' > .env
90-
aws ecr get-login-password | docker login --username AWS --password-stdin ${{ secrets.ECR_REGISTRY }}
91+
aws cp s3://${{ secrets.API_SPECIFICATION_BUCKET }}/api.yml
9192
export IMAGE_URI=${{ secrets.ECR_REGISTRY }}/${{ secrets.ECR_REPOSITORY }}:${{ github.sha }}
9293
docker-compose --env-file .env up -d --build
9394
notify-discord:
9495
name: Notify Discord
9596
runs-on: ubuntu-latest
9697
needs: deploy-container
9798
steps:
99+
- name: Checkout
100+
uses: actions/checkout@v4
101+
- name: Get commit
102+
id: get_commit
103+
run: echo "commit_message=$(git log -1 --pretty=%s)" >> "$GITHUB_OUTPUT"
98104
- name: Send Discord notification
99105
run: |
100106
curl -X POST -H "Content-Type: application/json" -d '{
@@ -118,7 +124,7 @@ jobs:
118124
},
119125
{
120126
"name": "Commit",
121-
"value": "[$(git log -1 --pretty=%s)](https://github.com/${{ github.repository }}/commit/${{ github.sha }})",
127+
"value": "[${{ steps.get_commit.outputs.commit_message }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})",
122128
"inline": true
123129
},
124130
{

docker/docker-compose.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
services:
2-
backend:
2+
gotchai-server:
33
image: ${IMAGE_URI}
44
container_name: gotchai-server
55
restart: always
66
environment:
77
- TZ=Asia/Seoul
8-
network_mode: host
8+
ports:
9+
- "8080:8080"
910
depends_on:
1011
- redis
1112
redis:
@@ -22,7 +23,7 @@ services:
2223
container_name: swagger
2324
ports:
2425
- "9090:8080"
26+
volumes:
27+
- ./api.yml:/usr/share/nginx/html/api.yml
2528
environment:
26-
- URLS_PRIMARY_NAME=gotchai
27-
- "URLS=[{ url: 'https://${API_SPECIFICATION_BUCKET}.s3.amazonaws.com/api.yml', name: 'gotchai' }]"
28-
- SUPPORTED_SUBMIT_METHODS=['get']
29+
- SWAGGER_JSON=/api.yml

0 commit comments

Comments
 (0)