Skip to content

Commit

Permalink
Merge pull request #22 from SoftBananas/ci-cd
Browse files Browse the repository at this point in the history
fix: deploy
  • Loading branch information
ONEPANTSU authored Mar 5, 2024
2 parents 249c2bf + e85560b commit 33cdc94
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,12 @@ jobs:
name: Update server by ssh
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Connect and run script
uses: garygrossgarten/github-action-ssh@0.7.0
uses: SoftBananas/ssh-action@v1.0.3
with:
host: ${{ secrets.SERVER_HOST }}
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
command: |
cd teamapp ||
cd mkdir teamapp &&
cd teamapp &&
git clone https://github.com/SoftBananas/teamapp-backend
git pull
echo "Stop containers"
docker-compose down
echo "Start container"
docker-compose up -d
echo "Finish deploying!"
script_stop: true
script: bash scripts/deploy.sh
12 changes: 0 additions & 12 deletions docker/deploy.sh

This file was deleted.

10 changes: 10 additions & 0 deletions scrpts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cd teamapp ||
cd mkdir teamapp && cd teamapp && git clone https://github.com/SoftBananas/teamapp-backend git pull

echo "Stop containers"
docker-compose down

echo "Start container"
docker-compose up -d

echo "Finish deploying!"

0 comments on commit 33cdc94

Please sign in to comment.