This commit is contained in:
Leonid Pershin
2025-10-17 05:54:32 +03:00
parent e549d1f68e
commit 566db308b3
3 changed files with 345 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
name: Auto Deploy
on:
workflow_run:
workflows: ["Deploy"]
types: [completed]
branches: [master]
jobs:
auto-deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Download deployment package
uses: actions/download-artifact@v3
with:
name: chatbot-deployment
path: ./deployment
- name: Deploy to server
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
cd /tmp
wget ${{ github.event.workflow_run.artifacts_url }}
tar -xzf chatbot-deployment-*.tar.gz
sudo ./deploy.sh
echo "Deployment completed successfully!"