Skip to content

Commit

Permalink
feat: master 브랜치의 배포 시에는 불필요한 도커 이미지 및 컨테이너 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
14hhan committed Nov 25, 2021
1 parent 4433cfe commit d825dd1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,18 @@ jobs:
key: ${{ secrets.KEY }}
script: |
sh /home/ubuntu/srv/ubuntu/config/scripts/deploy.sh
cleanup:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- name: delete useless images and containers
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ubuntu
key: ${{ secrets.KEY }}
script: |
sudo yes y | sudo docker image prune
sudo yes y | sudo docker container prune
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,6 @@ fabric.properties
# Cython debug symbols

# End of https://www.toptal.com/developers/gitignore/api/pycharm,django,python
.idea
.idea

.DS_Store

0 comments on commit d825dd1

Please sign in to comment.