https://github.com/eaudeweb/drupal-cleanup-action
Cleanup older deployments
https://github.com/eaudeweb/drupal-cleanup-action
Last synced: 4 months ago
JSON representation
Cleanup older deployments
- Host: GitHub
- URL: https://github.com/eaudeweb/drupal-cleanup-action
- Owner: eaudeweb
- Created: 2023-03-20T20:54:39.000Z (about 3 years ago)
- Default Branch: 1.x
- Last Pushed: 2024-08-15T13:56:56.000Z (almost 2 years ago)
- Last Synced: 2024-08-16T14:47:07.338Z (almost 2 years ago)
- Language: Shell
- Size: 21.5 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Directory cleanup action
This action does a SSH into a remote server and cleans up older deployments (directories) with a pre-defined pattern. Preserve only the newest number of configured directories.
Usage:
```
- name: 'Cleanup old releases'
uses: eaudeweb/drupal-cleanup-action@1.x
with:
ssh_user: ${{ secrets.TEST_SSH_USER }}
ssh_host: ${{ secrets.TEST_SSH_HOST }}
ssh_key: ${{ secrets.TEST_SSH_KEY }}
ssh_user_jumphost: ${{ secrets.TEST_SSH_USER_JUMPHOST }}
ssh_host_jumphost: ${{ secrets.TEST_SSH_HOST_JUMPHOST }}
cleanup_dir: /var/www/artifacts/example.org
pattern: *release-*
retain: 5
```
**Caveat**: When target directory contains other directories containing the pattern (e.g. `custom-release-backup`) cleanup won't work properly.