Skip to content

Commit 3387ee6

Browse files
authored
Merge pull request #146 from prgrms-web-devcourse-final-project/deploy-1
deploy
2 parents 749a93d + 9e03b91 commit 3387ee6

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.dockerignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ terraform/
4747
*.trace.db
4848

4949
# Environment
50-
.env
51-
.env.local
5250

5351
# Docker
5452
docker-compose.yml

.github/workflows/deploy.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
CONTAINER_PORT: 8080 # 컨테이너 내부 포트(스프링부트)
1111
EC2_INSTANCE_TAG_NAME: team12-ec2-1 # 배포 대상 EC2 Name 태그
1212
DOCKER_NETWORK: common # 도커 네트워크
13-
BACKEND_DIR: .
13+
BACKEND_DIR: . # Dockerfile 위치
1414

1515
concurrency:
1616
group: ${{ github.workflow }}-${{ github.ref }} # 커밋이 짧은 시간안에 몰려도 최신 커밋에 대해서만 액션이 수행되도록
@@ -20,7 +20,6 @@ on:
2020
push:
2121
paths:
2222
- ".github/workflows/**"
23-
- ".env"
2423
- "src/**"
2524
- "build.gradle.kts"
2625
- "settings.gradle.kts"
@@ -86,9 +85,8 @@ jobs:
8685
DOT_ENV: ${{ secrets.DOT_ENV }}
8786
run: |
8887
# .env가 없으면 빌드 캐시가 매번 깨질 수 있으므로 항상 생성
89-
echo "$DOT_ENV" > .env
90-
echo "$DOT_ENV"
91-
ls .env
88+
mkdir -p "${{ env.BACKEND_DIR }}"
89+
printf "%s" "${DOT_ENV}" > "${{ env.BACKEND_DIR }}/.env"
9290
9391
- name: Docker Buildx 설치
9492
uses: docker/setup-buildx-action@v3
@@ -112,7 +110,7 @@ jobs:
112110
- name: 빌드 앤 푸시
113111
uses: docker/build-push-action@v6
114112
with:
115-
context: .
113+
context: ${{ env.BACKEND_DIR }}
116114
push: true
117115
cache-from: type=gha
118116
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)