Skip to content

Commit 138510a

Browse files
authored
Merge pull request #174 from prgrms-web-devcourse-final-project/feat/githubAction
[feat] 깃허브 액션 추가
2 parents 4ef7f54 + 98bdb27 commit 138510a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/autoBuild.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: React CI with Vite
2+
3+
on:
4+
push:
5+
branches: [ "dev" ]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: '16' # 원하는 Node.js 버전으로 변경
18+
19+
- name: Build and Run Docker on Server
20+
uses: appleboy/ssh-action@master
21+
with:
22+
host: ${{ secrets.HOST }}
23+
username: ${{ secrets.USERNAME }}
24+
key: ${{ secrets.PRIVATE_KEY }}
25+
port: ${{ secrets.PORT }}
26+
27+
- name: Pull latest code from dev branch
28+
run: |
29+
cd /home/ubuntu/react
30+
git pull origin dev
31+
32+
- name: Install dependencies
33+
run: |
34+
npm install
35+
36+
- name: Build React app using Vite
37+
run: |
38+
npm run build

0 commit comments

Comments
 (0)