33 lines
868 B
YAML
33 lines
868 B
YAML
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!"
|