Skip to content

Commit

Permalink
Merge branch 'develop' into websockets
Browse files Browse the repository at this point in the history
  • Loading branch information
Foroxon committed Jan 26, 2024
2 parents 237daaa + c35696c commit 401256b
Show file tree
Hide file tree
Showing 2 changed files with 157 additions and 0 deletions.
146 changes: 146 additions & 0 deletions .github/workflows/deploy_server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: ☁️ Deploy Microservices
on:
workflow_dispatch:
inputs:
redeploy_all:
type: boolean
default: false
description: Redeploy all (be careful!)
redeploy_tcp_sockets:
type: boolean
default: false
description: TCP Sockets
redeploy_update_server:
type: boolean
default: false
description: Update server (bin list)
redeploy_web_server:
type: boolean
default: false
description: Web server
redeploy_alerts:
type: boolean
default: false
description: Alerts
polling-interval:
type: number
default: 2
description: Polling interval (seconds)
redeploy_weather:
type: boolean
default: false
description: Weather
redeploy_updater:
type: boolean
default: false
description: Updater
redeploy_svg_generator:
type: boolean
default: false
description: SVG Generator
redeploy_explosions:
type: boolean
default: false
description: Explosions

run-name: Deploy Microservices from '${{ github.ref_name }}' branch
jobs:
deploy_microservices:
runs-on: ubuntu-latest
steps:
- name: Redeploy TCP Sockets
if: ${{ inputs.redeploy_tcp_sockets || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
bash redeploy_tcp_server.sh -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Update Server (bin list)
if: ${{ inputs.redeploy_update_server || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
bash redeploy_update_server.sh -s '/root/ukraine_alarm_map/bin'
- name: Redeploy Web Server
if: ${{ inputs.redeploy_web_server || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
bash redeploy_web_server.sh -d ${{ secrets.WEB_TOKEN }} -p 80 -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Alerts
if: ${{ inputs.redeploy_alerts || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
bash redeploy_alerts.sh -a ${{ secrets.AIR_ALARM_API_KEY }} -p ${{ inputs.polling-interval }} -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Weather
if: ${{ inputs.redeploy_weather || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
bash redeploy_weather.sh -w ${{ secrets.WEATHER_TOKEN }} -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Updater
if: ${{ inputs.redeploy_updater || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
bash redeploy_updater.sh -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Svg Generator
if: ${{ inputs.redeploy_svg_generator || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
bash redeploy_svg_generator.sh -m ${{ secrets.MEMCACHED_HOST }}
- name: Redeploy Explosions
if: ${{ inputs.redeploy_explosions || inputs.redeploy_all }}
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout ${{ github.ref_name }}
bash redeploy_explosions.sh -e ${{ secrets.ETRYVOGA_HOST }} -m ${{ secrets.MEMCACHED_HOST }}
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,15 @@ jobs:
head_to_merge: ${{ steps.commit_changes.outputs.commit_hash }}
message: Sync Release ${{ inputs.release-version }} to develop
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update server bin list
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_SSH_USER }}
password: ${{ secrets.SERVER_SSH_PASSWORD }}
script: |
cd /root/ukraine_alarm_map/deploy/
git fetch --all
git checkout master
bash redeploy_update_server.sh -s '/root/ukraine_alarm_map/bin'

0 comments on commit 401256b

Please sign in to comment.