Skip to content

[CHORE] 채팅 기능 CSS 및 위치 수정 (#34) #11

[CHORE] 채팅 기능 CSS 및 위치 수정 (#34)

[CHORE] 채팅 기능 CSS 및 위치 수정 (#34) #11

name: Build and Deploy
on:
push:
branches: [main]
jobs:
build-and-deploy:
runs-on: ubuntu-22.04
env:
CI: false
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.9.0'
- name: Docker build and push
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/thepopbusinessweb .
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
docker push ${{ secrets.DOCKER_USERNAME }}/thepopbusinessweb
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
script: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
# Stop and remove the existing container
docker stop thepopbusinessweb || true
docker rm thepopbusinessweb || true
# Remove the existing image
docker rmi ${{ secrets.DOCKER_USERNAME }}/thepopbusinessweb || true
# Copy Nginx configuration file
scp nginx.conf ubuntu@${{ secrets.HOST }}:/path/to/nginx.conf
# Build, push, pull and run the application container
docker build -t ${{ secrets.DOCKER_USERNAME }}/thepopbusinessweb .
docker push ${{ secrets.DOCKER_USERNAME }}/thepopbusinessweb
docker pull ${{ secrets.DOCKER_USERNAME }}/thepopbusinessweb
docker run -d -p 80:80 --name thepopbusinessweb ${{ secrets.DOCKER_USERNAME }}/thepopbusinessweb