Skip to content

Commit

Permalink
Update prod.yml
Browse files Browse the repository at this point in the history
depend on ci
  • Loading branch information
Rob-in-son authored Aug 9, 2024
1 parent ffce86a commit de40e9a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Deploy to prod Branch

on:
push:
branches:
- prod
workflow_run:
workflows: [CI]
types:
- completed
branches: [main]

jobs:
build-and-deploy:
Expand Down Expand Up @@ -42,13 +44,12 @@ jobs:
- name: Deploy and start on remote server
run: |
sshpass -p ${{ secrets.PASSWORD }} ssh -o StrictHostKeyChecking=no ${{ secrets.USERNAME }}@${{ secrets.HOST }} "
cd /var/www/aihomework/dev
cd /var/www/aihomework/prod
git stash
git pull origin dev
git pull origin main
docker load -i /tmp/docker-images.tar.gz
docker compose -f docker-compose.production.yml down
docker compose -f docker-compose.production.yml up -d
rm /tmp/docker-images.tar.gz
"
env:
SSH_HOST: ${{ secrets.HOST }}
Expand Down

0 comments on commit de40e9a

Please sign in to comment.