-
Notifications
You must be signed in to change notification settings - Fork 283
39 lines (37 loc) · 1.27 KB
/
deploy-playground.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
38
39
name: Deploy Playground
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
workflow_run:
branches:
- master
workflows:
# Wait until "Publish turms-admin" is completed
# because it's always the slowest workflow
- "Publish turms-admin"
# - "Publish turms-gateway"
# - "Publish turms-service"
types:
- completed
jobs:
deploy:
if: ${{ !github.event.workflow_run || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-22.04
steps:
- name: SSH
uses: appleboy/[email protected]
with:
host: ${{ secrets.PLAYGROUND_SSH_HOST }}
username: ${{ secrets.PLAYGROUND_SSH_USERNAME }}
key: ${{ secrets.PLAYGROUND_SSH_KEY }}
script_stop: true
script: |
cd /opt/turms
sudo docker compose -f docker-compose.standalone.yml down --remove-orphans
sudo docker system prune -a -f
sudo docker system prune --volumes -f
sudo rm -rf /var/log/journal
sudo git reset --hard
sudo git pull
sudo ENV=dev,demo INITIAL_ROOT_PASSWORD='${{ secrets.PLAYGROUND_ROOT_PASSWORD }}' docker compose -f docker-compose.standalone.yml --profile monitoring up --force-recreate -d