-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.43 KB
/
npm-publish-github-packages.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
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: npm package deploy # Workflow 이름
on: # Event 감지
push:
branches:
- develop
jobs: # Job 설정
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code. # Repo checkout
uses: actions/checkout@v3
- name: Check Node v # Node v 확인
run: node -v
- name: Install dependencies # 의존 파일 설치
run: npm install
- name: Generate build # React Build
run: npm run build
- name: SCP over ssh
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
port: ${{ secrets.PORT }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
source: './build'
target: '/home/ubuntu'
- name: Copy build files to public folder over ssh
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
port: ${{ secrets.PORT }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: |
cp -rp build/* public