Skip to content

add option to bind to the local IP #64

add option to bind to the local IP

add option to bind to the local IP #64

name: Deploy to main server using ssh
on:
push:
branches:
- main
jobs:
build:
name: Deploy To Main Server
runs-on: ubuntu-latest
steps:
- name: Install packages
run: |
sudo apt-get install openfortivpn
curl $CERTS_URL -o geant_ov_rsa_ca.crt -s
sudo cp geant_ov_rsa_ca.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates
touch custom_config
echo "host = $VPN_HOST" >> custom_config
echo "port = 443" >> custom_config
echo "realm = $VPN_REALM" >> custom_config
echo "username = $VPN_USER" >> custom_config
echo "password = $VPN_PSWD" >> custom_config
sudo openfortivpn -c custom_config > openfortivpn_local.log 2>&1&
sleep 15
env:
VPN_HOST: ${{secrets.VPN_HOST}}
VPN_REALM: ${{secrets.VPN_REALM}}
VPN_USER: ${{secrets.VPN_USER}}
VPN_PSWD: ${{secrets.VPN_PSWD}}
CERTS_URL: ${{secrets.CERTS_URL}}
- name: Deploying Server
uses: appleboy/[email protected]
env:
POSTGRESQL_DB_URL: ${{secrets.POSTGRESQL_DB_URL}}
MYSQL_DB_URL: ${{secrets.MYSQL_DB_URL}}
ALLOWED_BOT_USERS: ${{secrets.ALLOWED_BOT_USERS}}
BOT_TOKEN: ${{secrets.BOT_TOKEN}}
SECRET_KEY: ${{secrets.SECRET_KEY}}
STATION_TYPE: MAIN_SERVER
VERSION: ${{github.sha}}
ENV: PROD
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
envs: POSTGRESQL_DB_URL,MYSQL_DB_URL,ALLOWED_BOT_USERS,BOT_TOKEN,SECRET_KEY,STATION_TYPE,VERSION,ENV
script: |
cd aiq_coap_server/
git checkout main && git pull
cd server/
/home/admin/.local/bin/poetry install --only main
make create-env
make stop-server
make run-backup-migrations
make run-main-migrations
make start-server