update the docker exec command #22
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Test | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{secrets.SERVER_IP}} | |
username: ${{secrets.SERVER_USERNAME}} | |
key: ${{secrets.SSH_PRIVATE_KEY}} | |
script_stop: true | |
command_timeout: 200m | |
script: | | |
cd /home/apps/workflow-app | |
git pull | |
docker-compose up -d | |
docker exec backend npm run test | |
docker-compose down | |
deploy: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Deploy to Production | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{secrets.SERVER_IP}} | |
username: ${{secrets.SERVER_USERNAME}} | |
key: ${{secrets.SSH_PRIVATE_KEY}} | |
script_stop: true | |
command_timeout: 200m | |
script: | | |
cd /home/apps/workflow-app | |
git pull | |
docker-compose -f docker-compose-prod.yaml up -d --build |