Skip to content

Commit

Permalink
🐳add cleaning stage into build
Browse files Browse the repository at this point in the history
  • Loading branch information
SamBWagner committed Nov 4, 2024
1 parent ea135ed commit 197b144
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,19 @@ jobs:
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H "${{ secrets.VPS_IP }}" >> ~/.ssh/known_hosts
- name: Clean up Docker on VPS
run: |
ssh "${{ secrets.VPS_SSH_LOGIN }}" "
docker system prune -af --volumes
"
- name: Deploy to VPS
run: |
ssh "${{ secrets.VPS_SSH_LOGIN }}" "
cd /var/www/port-flow &&
docker login --username sambwagner --password ${{ secrets.GHCR_PAT }} ghcr.io
docker login --username sambwagner --password ${{ secrets.GHCR_PAT }} ghcr.io &&
docker pull ghcr.io/sambwagner/port-flow-ui:latest &&
docker stop port-flow-ui || true &&
docker rm port-flow-ui || true &&
docker rm -f port-flow-ui || true &&
docker run -d --name port-flow-ui -p 3000:3000 ghcr.io/sambwagner/port-flow-ui:latest
"

0 comments on commit 197b144

Please sign in to comment.