Skip to content

Commit

Permalink
Fix: clean up docker cache and images
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchayan721 committed Aug 29, 2023
1 parent ef0e06a commit 546da24
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v2

- name: SSH and Deploy
- name: SSH and Cleanup
run: |
echo "Setting up Git Config"
mkdir -p ~/.ssh/
echo "Setting up SSH Keys"
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
Expand All @@ -32,16 +32,21 @@ jobs:
echo "Pulling Latest Code from Development Branch"
git pull origin development
echo "Stopping and Rebuilding Docker Containers"
docker compose down
docker compose build --no-cache
echo "Cleaning up old Docker images"
docker image prune -a -f
echo "Cleaning up old log files"
find ~/ims-website/logs/* -mtime +7 -exec rm {} \\;
echo "Rebuilding Docker Containers"
docker compose build
echo "Starting Docker Containers"
docker compose up -d
exit
EOF
echo "Deployment on Staging Server Completed"
echo "Deployment and Cleanup on Staging Server Completed"
- name: Gathering Email and Mail List
id: prepare_email
Expand Down

0 comments on commit 546da24

Please sign in to comment.