-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (65 loc) · 2.1 KB
/
back-media-cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: 백엔드 @app/media CD
on:
push:
branches: [main, release, fix/#347/media-build]
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: ✅ 체크아웃
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: ☑️ pnpm 버전 설정
uses: pnpm/action-setup@v3
with:
version: 9
- name: ☑️ 노드 버전 설정
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: .env 파일 생성
run: |
jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]' <<< "$SECRETS_CONTEXT" > .env
mv .env apps/media/.env
env:
SECRETS_CONTEXT: ${{ toJson(secrets) }}
- name: ⬇️ 의존성 설치
run: pnpm install --frozen-lockfile
- name: 📦 프로젝트 빌드
run: pnpm build:media
- name: 빌드 결과물
run: ls ./apps/media
# build:
# runs-on: ubuntu-latest
# needs: ci
# steps:
# - name: ✅ 체크아웃
# uses: actions/checkout@v4
# with:
# fetch-depth: 2
# - name: 🐳 Docker 로그인
# uses: docker/login-action@v3
# with:
# registry: ${{secrets.DOCKER_REGISTRY_URL}}
# username: ${{secrets.DOCKER_REGISTRY_ACCESS_KEY}}
# password: ${{secrets.DOCKER_REGISTRY_SECRET_KEY}}
- name: 🐳 Docker 빌드 및 푸시
run: |
echo "Starting Docker build..."
docker buildx build -f apps/media/Dockerfile .
echo "Docker build completed."
- name: 🐳 Docker 실행
run: |
echo "Starting Docker container..."
docker run -d -p 3002:3002 --name media-app my-media-app
echo "Docker container started."
- name: 🐳 Docker 상태 확인
run: |
sleep 10 # 컨테이너가 시작될 시간을 주기 위한 대기 시간
docker ps -a
docker logs media-app # 로그 확인