-
-
Notifications
You must be signed in to change notification settings - Fork 5
36 lines (30 loc) · 935 Bytes
/
Copy pathcleanup-css.yml
File metadata and controls
36 lines (30 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Cleanup CSS on branch deletion
on:
delete:
branches:
- '**'
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
contents: read
if: github.event.ref_type == 'branch'
steps:
- name: Install lftp
run: sudo apt-get update && sudo apt-get install -y lftp
- name: Remove branch CSS from CDN
env:
SFTP_HOST: ${{ secrets.FTP_HOST }}
SFTP_USER: ${{ secrets.FTP_USER }}
SFTP_PASS: ${{ secrets.FTP_PASS }}
run: |
BRANCH=${{ github.event.ref }}
echo "🗑️ Cleaning up CSS for deleted branch: ${BRANCH}"
# Supprimer le dossier de la branche via SFTP
lftp -c "
set sftp:auto-confirm yes
open -u ${SFTP_USER},${SFTP_PASS} sftp://${SFTP_HOST}
rm -rf www/odio-css/${BRANCH}
bye
"
echo "✅ Cleaned up CSS for branch ${BRANCH}"