Clean Docker Cache #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Clean Docker Cache | |
on: | |
schedule: | |
# 每15天凌晨0点运行一次 | |
- cron: '0 0 */15 * *' | |
jobs: | |
cleanup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Connect server to clean docker cache | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
echo "🧹 Starting Docker system prune..." | |
docker system prune -f | |
echo "✅ Docker cache cleaned successfully" |