Skip to content

Deploy Microservices from 'google_cloud' branch #44

Deploy Microservices from 'google_cloud' branch

Deploy Microservices from 'google_cloud' branch #44

Workflow file for this run

name: ☁️ Deploy Microservices
on:
workflow_dispatch:
inputs:
redeploy_all:
type: boolean
default: false
description: Redeploy all (be careful!)
redeploy_web_sockets:
type: boolean
default: false
description: WebSockets
redeploy_web_server:
type: boolean
default: false
description: Web server
run-name: Deploy Microservices from '${{ github.ref_name }}' branch
jobs:
deploy_microservices:
runs-on: ubuntu-latest
steps:
- name: Redeploy WebSockets
if: ${{ inputs.redeploy_web_sockets || inputs.redeploy_all }}
uses: appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.GOOGLE_CLOUD_IP }}
username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
script: |
cd esp32_grid_detector/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_websocket_server.sh -m ${{ secrets.MEMCACHED_HOST }} -u ${{ secrets.ENDPOINT_URL }} -e PROD
- name: Redeploy Web Server
if: ${{ inputs.redeploy_web_server || inputs.redeploy_all }}
uses: appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.GOOGLE_CLOUD_IP }}
username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
script: |
cd esp32_grid_detector/deploy/
git fetch --all
git switch ${{ github.ref_name }}
git pull
bash redeploy_web_server.sh -d ${{ secrets.WEB_TOKEN }} -m ${{ secrets.MEMCACHED_HOST }}
- name: Clear unused images
uses: appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.GOOGLE_CLOUD_IP }}
username: ${{ secrets.GOOGLE_CLOUD_SSH_USER }}
key: ${{ secrets.GOOGLE_PRIVATE_SSH }}
script: |
docker image prune -f