Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deploy.yml #46

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ jobs:
docker-compose -f docker-compose.yml build
docker-compose -f docker-compose.yml push

- name: SSH into server and deploy
- name: Checkout repository
uses: actions/checkout@v2

- name: Install sshpass
run: sudo apt-get install -y sshpass

- name: Copy docker-compose.yml to server
run: scp -P ${{ secrets.SERVER_PORT }} docker-compose.yml ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}:/home/ivan/teamapp/docker-compose.yml

- name: Deploy to server
run: |
sshpass -p ${{ secrets.SERVER_PASSWORD }} ssh -tt -p ${{ secrets.SERVER_PORT }} ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }} 'cd /home/ivan && (cd teamapp || (cd mkdir teamapp && cd teamapp && git clone https://github.com/SoftBananas/teamapp-backend.git && git pull)) && cd teamapp && touch .env.prod && echo "${{ secrets.ENV }}" > .env.prod && docker-compose -f docker-compose.yml down && docker-compose -f docker-compose.yml up -d'
sshpass -p ${{ secrets.SERVER_PASSWORD }} ssh -p ${{ secrets.SERVER_PORT }} ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }} "cd /home/ivan/teamapp/ && docker-compose up -d"
Loading