Skip to content

Commit 4d9ae9a

Browse files
committed
Update Fix Duplicate Folder, File
1 parent 09d3d2a commit 4d9ae9a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,26 @@ jobs:
180180
test -f deploy_bundle/monitoring/loki-config.yml
181181
test -f deploy_bundle/monitoring/promtail-config.yml
182182
183+
- name: Pre-clean monitoring paths on server
184+
uses: appleboy/[email protected]
185+
with:
186+
host: ${{ secrets.SSH_HOST }}
187+
username: ${{ secrets.SSH_USER }}
188+
key: ${{ secrets.SSH_PRIVATE_KEY }}
189+
port: ${{ secrets.SSH_PORT }}
190+
script: |
191+
set -euo pipefail
192+
DEPLOY_DIR='${{ steps.targetdir.outputs.DEPLOY_DIR_FINAL }}'
193+
mkdir -p "$DEPLOY_DIR/monitoring/grafana/provisioning"
194+
195+
# Nếu lỡ có THƯ MỤC trùng tên file, xóa đi
196+
for f in prometheus.yml loki-config.yml promtail-config.yml; do
197+
if [ -d "$DEPLOY_DIR/monitoring/$f" ]; then
198+
echo "Found directory at $DEPLOY_DIR/monitoring/$f -> removing"
199+
rm -rf "$DEPLOY_DIR/monitoring/$f"
200+
fi
201+
done
202+
183203
- name: Upload bundle to server
184204
uses: appleboy/[email protected]
185205
with:

0 commit comments

Comments
 (0)