Skip to content

Deploy Dev Websockets from 'google_cloud' branch #32

Deploy Dev Websockets from 'google_cloud' branch

Deploy Dev Websockets from 'google_cloud' branch #32

name: 🧪 Deploy Dev Websockets
on:
workflow_dispatch:
inputs:
random_mode:
type: boolean
default: false
description: Random Alerts Mode
test_mode:
type: boolean
default: false
description: Test Mode (linear change)
fetch_interval:
type: number
default: 1
description: Memcached Fetch Interval (seconds)
run-name: Deploy Dev Websockets from '${{ github.ref_name }}' branch
jobs:
deploy_websocket_dev:
runs-on: ubuntu-latest
steps:
- name: Redeploy Dev WebSockets
uses: appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.CLOUD_SERVER_IP }}
username: ${{ secrets.CLOUD_SERVER_USER }}
key: ${{ secrets.CLOUD_SERVER_SSH_KEY }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_websocket_server_dev.sh -m ${{ secrets.CLOUD_MEMCACHED_HOST }} -s ${{ secrets.API_SECRET }} -i ${{ secrets.MEASUREMENT_ID }} -r ${{ inputs.random_mode && 'True' || 'False' }} -t ${{ inputs.test_mode && 'True' || 'False' }} -f ${{ inputs.fetch_interval }}
- name: Clear unused images
uses: appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.CLOUD_SERVER_IP }}
username: ${{ secrets.CLOUD_SERVER_USER }}
key: ${{ secrets.CLOUD_SERVER_SSH_KEY }}
script: |
docker image prune -f