merge: [BE] 백엔드 릴리즈 #125 #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: backEnd signaling server CD | |
on: | |
push: | |
branches: [BE/release, main] | |
permissions: | |
contents: read | |
jobs: | |
signaling-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/signaling | |
run: npm ci | |
- name: 📦 프로젝트 빌드 | |
working-directory: ./backEnd/signaling | |
run: npm run build | |
- name: 🐳 도커 로그인 | |
working-directory: ./backEnd/signaling | |
run: | | |
docker login -u ${{ secrets.DOCKER_SIGNALING_USERNAME }} -p ${{ secrets.DOCKER_SIGNALING_PASSWORD }} | |
docker build -t ${{ secrets.DOCKER_SIGNALING_REPO }}/signaling . | |
docker push ${{ secrets.DOCKER_SIGNALING_REPO }}/signaling | |
- name: 🏃♂️Deploy | |
uses: appleboy/[email protected] | |
with: | |
host: ${{secrets.SIGNALING_HOST}} | |
username: ${{secrets.SIGNALING_USERNAME}} | |
password: ${{secrets.SIGNALING_PASSWORD}} | |
port: ${{secrets.SIGNALING_PORT}} | |
script: | | |
echo "PORT=${{ secrets.SIGNALING_SERVER_PORT }}" > /root/.env | |
echo "ALLOWED_ORIGIN=${{ secrets.SIGNALING_ALLOWED_ORIGIN }}" >> /root/.env | |
echo "SOCKET_URL=${{ secrets.SERVER_A_SOCKET_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 |