Merge pull request #133 from TeamOwori/chore/#127/divide-server #87
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: Owori Backend CD | |
on: | |
push: | |
branches: ["main", "develop"] | |
jobs: | |
server-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the code (prod) | |
- name: executing remote ssh commands using password | |
if: github.ref == 'refs/heads/main' | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.AWS_IP_PROD }} | |
username: ubuntu | |
key: ${{ secrets.SSH_PRIVATE_KEY_PROD }} | |
script: | | |
cd ~/Owori-Server | |
git pull | |
sudo docker-compose -f docker-compose.prod.yml down | |
sudo docker-compose -f docker-compose.prod.yml up --build -d | |
# Checkout the code (dev) | |
- name: executing remote ssh commands using password | |
if: github.ref == 'refs/heads/develop' | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.AWS_IP_DEV }} | |
username: ubuntu | |
key: ${{ secrets.SSH_PRIVATE_KEY_DEV }} | |
script: | | |
cd ~/Owori-Server | |
git pull | |
sudo docker-compose -f docker-compose.yml down | |
sudo docker-compose -f docker-compose.yml up --build -d |