Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ZYNORl authored Dec 27, 2023
1 parent 980a8ec commit 6473bd7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Build Docker Images
- name: Build Docker Images
run: |
docker-compose -f docker-compose.yml build
Expand All @@ -31,13 +31,13 @@ jobs:
sudo apt-get update
sudo apt-get install -y sshpass
- name: Connect Docker on Ubuntu Server and remove previously useless images
- name: Connect Docker on Ubuntu Server!
env:
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
SERVER_IP: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}
run: |
sshpass -p "${SSH_PASSWORD}" ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SERVER_IP} "docker image prune"
sshpass -p "${SSH_PASSWORD}" ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SERVER_IP} "docker version"
- name: Push images to Docker Repository!
Expand All @@ -50,3 +50,11 @@ jobs:
docker save petplanet-pet-image:latest | gzip | sshpass -p "${SSH_PASSWORD}" ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SERVER_IP} "gzip -d | docker load"
docker save petplanet-post-image:latest | gzip | sshpass -p "${SSH_PASSWORD}" ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SERVER_IP} "gzip -d | docker load"
docker save petplanet-user-image:latest | gzip | sshpass -p "${SSH_PASSWORD}" ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SERVER_IP} "gzip -d | docker load"
- name: Remove previously useless images!!!
env:
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
SERVER_IP: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}
run: |
sshpass -p "${SSH_PASSWORD}" ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SERVER_IP} "docker image prune"

0 comments on commit 6473bd7

Please sign in to comment.