Skip to content

merge: [BE] 코드 실행기능 리팩터링 및 README.md 수정 #22

merge: [BE] 코드 실행기능 리팩터링 및 README.md 수정

merge: [BE] 코드 실행기능 리팩터링 및 README.md 수정 #22

name: backEnd running server CD
on:
push:
branches: [BE/release, main]
permissions:
contents: read
jobs:
running-server:
runs-on: ubuntu-latest
steps:
- name: ✅ 코드 체크아웃
uses: actions/checkout@v3
- name: 👻 노드 설정
uses: actions/setup-node@v3
with:
node-version: 18.16.0
- name: ⬇️ 의존성 설치
working-directory: ./backEnd/running
run: npm ci
- name: 📦 프로젝트 빌드
working-directory: ./backEnd/running
run: npm run build
- name: 🐳 도커 로그인
working-directory: ./backEnd/running
run: |
docker login -u ${{ secrets.DOCKER_RUNNING_USERNAME }} -p ${{ secrets.DOCKER_RUNNING_PASSWORD }}
docker build -t ${{ secrets.DOCKER_RUNNING_REPO }}/running .
docker push ${{ secrets.DOCKER_RUNNING_REPO }}/running
- name: 🏃‍♂️Deploy
uses: appleboy/[email protected]
with:
host: ${{secrets.RUNNING_HOST}}
username: ${{secrets.RUNNING_USERNAME}}
password: ${{secrets.RUNNING_PASSWORD}}
port: ${{secrets.RUNNING_PORT}}
script: |
echo "PORT=${{ secrets.RUNNING_SERVER_PORT }}" > /root/.env
echo "ALLOWED_ORIGIN=${{ secrets.RUNNING_ALLOWED_ORIGIN }}" >> /root/.env
echo "WEB_HOOK_URL=${{ secrets.WEB_HOOK_URL }}" >> /root/.env
echo "NODE_ENV=production" >> /root/.env
echo "REDIS_HOST=${{ secrets.REDIS_HOST }}" >> /root/.env
echo "REDIS_PORT=${{ secrets.REDIS_PORT }}" >> /root/.env
echo "REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }}" >> /root/.env
./deploy.sh