Skip to content

Commit 72a4f87

Browse files
committed
feat: 배포 파이프라인 구축
1 parent 39d514c commit 72a4f87

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

.github/workflows/cd.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: cd
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v5
12+
- name: creates output
13+
run: sh ./build.sh
14+
- name: Pushes to another repository
15+
id: push_directory
16+
uses: cpina/github-action-push-to-another-repository@main
17+
env:
18+
API_TOKEN_GITHUB: ${{ secrets.AUTO_ACTIONS }}
19+
with:
20+
source-directory: "output"
21+
destination-github-username: odukong
22+
destination-repository-name: COMFIT-LANDING
23+
user-email: ${{ secrets.EMAIL }}
24+
commit-message: ${{ github.event.head_commit.message }}
25+
target-branch: ${{ github.ref_name }}
26+
- name: Test get variable exported by push-to-another-repository
27+
run: echo $DESTINATION_CLONED_DIRECTORY

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
9+
permissions:
10+
contents: read # 코드 읽기 권한
11+
pull-requests: write # 자동리뷰어 설정을 위한 쓰기 권한
12+
13+
jobs:
14+
build-and-deploy:
15+
runs-on: ubuntu-latest
16+
steps:
17+
# 저장소 코드 다운로드
18+
- name: Checkout Code
19+
uses: actions/checkout@v5
20+
# pnpm 설치
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 10
25+
26+
# pnpm store 캐싱
27+
- name: Get pnpm store directory
28+
id: pnpm-cache
29+
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
30+
31+
- uses: actions/cache@v5
32+
with:
33+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
34+
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
35+
restore-keys: ${{ runner.os }}-pnpm-
36+
37+
# node.js 환경 설정
38+
- name: Setup Node.js
39+
uses: actions/setup-node@v5
40+
with:
41+
node-version: "24.x"
42+
# 라이브러리 설치
43+
- name: Install dependencies
44+
run: pnpm install --frozen-lockfile
45+
# 프로젝트 린트 검사 및 타입 검사
46+
- name: Check project
47+
id: check_step
48+
run: pnpm run lint && pnpm exec tsc --noEmit
49+
continue-on-error: true
50+
# 프로젝트 빌드
51+
- name: Build project
52+
id: build_step
53+
run: pnpm run build
54+
continue-on-error: true
55+
56+
# 빌드 실패 시, 종료
57+
- name: Check Build Status
58+
if: steps.check_step.outcome == 'failure' || steps.build_step.outcome == 'failure'
59+
run: exit 1

0 commit comments

Comments
 (0)