Deploy Playground #525
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |