Skip to content

Commit 8945c32

Browse files
committed
chore[deploy]: deploy.yml 를 CI-CD_Pipeline.yml에 병합
1 parent dc49b64 commit 8945c32

File tree

3 files changed

+25
-96
lines changed

3 files changed

+25
-96
lines changed

.github/workflows/CI-CD_Pipeline.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jobs:
126126
run: |
127127
cat > .env << 'EOF'
128128
# JWT Configuration Properties 바인딩용 (빌드 시 필요)
129-
CUSTOM_JWT_SECRET_KEY=build-dummy-key-for-configuration-properties-binding
129+
CUSTOM_JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }}
130130
CUSTOM_JWT_ACCESS_TOKEN_EXPIRATION_SECONDS=3600
131131
EOF
132132
@@ -178,7 +178,29 @@ jobs:
178178
file: backend/Dockerfile
179179
push: true
180180
tags: |
181-
${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/backend:${{ github.sha }}
182-
${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/backend:latest
181+
${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/balaw:${{ github.sha }}
182+
${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/balaw:latest
183183
cache-from: type=gha
184184
cache-to: type=gha,mode=max
185+
deploy:
186+
needs: docker-build
187+
runs-on: ubuntu-latest
188+
env:
189+
DOCKER_IMAGE_NAME: balaw
190+
steps:
191+
- name: AWS SSM Send-Command
192+
uses: peterkimzz/aws-ssm-send-command@master
193+
id: ssm
194+
with:
195+
aws-region: ${{ secrets.AWS_REGION }}
196+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
197+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
198+
instance-ids: "i-0b903187bca01a1c4"
199+
working-directory: /
200+
comment: Deploy
201+
command: |
202+
docker pull ghcr.io/doohyojeong/${{ env.DOCKER_IMAGE_NAME }}:latest
203+
docker stop app1 2>/dev/null
204+
docker rm app1 2>/dev/null
205+
docker run -d --name app1 -p 8080:8080 ghcr.io/doohyojeong/${{ env.DOCKER_IMAGE_NAME }}:latest
206+
docker rmi $(docker images -f "dangling=true" -q)

.github/workflows/deploy.yml

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

backend/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ COPY settings.gradle .
1212
RUN gradle dependencies --no-daemon
1313

1414
# 소스 코드 복사
15-
COPY .env .
1615
COPY src src
1716

1817
# 애플리케이션 빌드

0 commit comments

Comments
 (0)