Skip to content

Merge pull request #188 from bsideproject/QA #190

Merge pull request #188 from bsideproject/QA

Merge pull request #188 from bsideproject/QA #190

Workflow file for this run

name: deploy
# action trigger
on:
push:
branches:
- master
# action
jobs:
# build process
build:
# OS Environment
runs-on: ubuntu-20.04
env:
# Ignore Warning
CI: false
strategy:
matrix:
# Nodejs Compile Version
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{matrix.node-version}}
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node-version}}
cache: "npm"
- name: Generate Env Variables for Secret
run: |
echo "REACT_APP_KAKAO_JAVASCRIPT_KEY=$REACT_APP_KAKAO_JAVASCRIPT_KEY" >> .env
echo "REACT_APP_KAKAO_REST_API_KEY=$REACT_APP_KAKAO_REST_API_KEY" >> .env
env:
REACT_APP_KAKAO_JAVASCRIPT_KEY: ${{secrets.REACT_APP_KAKAO_JAVASCRIPT_KEY}}
REACT_APP_KAKAO_REST_API_KEY: ${{secrets.REACT_APP_KAKAO_REST_API_KEY}}
- name: Install modules
run: npm install
- name: Build Project
run: npm run build
- name: Deploy build outputs
uses: appleboy/scp-action@master
with:
username: ${{secrets.NCP_USERNAME}}
host: ${{secrets.NCP_HOST}}
password: ${{secrets.NCP_PASSWORD}}
port: ${{secrets.NCP_PORT}}
source: "build/*"
strip_components: 1
target: "static"
# deploy process
deploy:
needs: build
runs-on: ubuntu-20.04
steps:
- name: Execute deploy.sh
uses: appleboy/ssh-action@master
with:
username: ${{secrets.NCP_USERNAME}}
host: ${{secrets.NCP_HOST}}
password: ${{secrets.NCP_PASSWORD}}
port: ${{secrets.NCP_PORT}}
script_stop: true
script: chmod -R +x ~/static && ~/static/deploy.sh