feat: 기본 셋팅 #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: sarabwayu | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' # 원하는 Node.js 버전을 지정하세요 | |
- name: Install Dependencies | |
run: npm install | |
- name: Build Project | |
run: npm run build | |
- name: Deploy to Server | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.NCP_HOST }} | |
username: ${{ secrets.NCP_USER }} | |
password: ${{ secrets.NCP_PASSWORD }} | |
source: "./build/*" | |
target: "/sarabwayu" | |
- name: Restart Web Server (Optional) | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.NCP_HOST }} | |
username: ${{ secrets.NCP_USER }} | |
password: ${{ secrets.NCP_PASSWORD }} | |
script: | | |
sudo systemctl restart nginx |