-
-
Notifications
You must be signed in to change notification settings - Fork 47
37 lines (31 loc) · 1.07 KB
/
deployment.yml
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
37
name: Deployment
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
pre_commit_ci:
uses: vutfitdiscord/rubbergod/.github/workflows/lint.yml@main
deployment_production:
runs-on: ubuntu-latest
environment: Production
needs: pre_commit_ci
if: github.ref == 'refs/heads/main'
steps:
- name: Execute deployment on SSH
uses: appleboy/[email protected]
with:
host: ${{ secrets.PRODUCTION_HOST }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
username: ${{ secrets.PRODUCTION_USERNAME }}
port: 22
script: |
echo "================== Pull Changes =================="
cd rubbergod
git pull
echo "================== Build Image =================="
docker build . --tag rubbergod-bot
echo "================== Restart Services =================="
docker compose down && docker compose up -d
echo "================== Clean Up Images =================="
echo "y" | docker image prune -a