Skip to content

remove confidence as not possible currently. #26

remove confidence as not possible currently.

remove confidence as not possible currently. #26

Workflow file for this run

name: Deploy Eunomnia
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Push to GitHub Container Registry
uses: docker/build-push-action@v6
with:
platforms: amd64, arm64
file: ./Dockerfile
context: .
tags: ghcr.io/ls1intum/eunomnia-app:latest
push: true
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Copy Docker Compose File From Repo to VM Host
uses: appleboy/[email protected]
with:
host: ${{ vars.VM_HOST }}
username: ${{ vars.VM_USERNAME }}
key: ${{ secrets.VM_SSH_PRIVATE_KEY }}
proxy_host: ${{ vars.DEPLOYMENT_GATEWAY_HOST }}
proxy_username: ${{ vars.DEPLOYMENT_GATEWAY_USER }}
proxy_key: ${{ secrets.DEPLOYMENT_GATEWAY_SSH_KEY }}
proxy_port: ${{ vars.DEPLOYMENT_GATEWAY_PORT }}
source: "./docker-compose.yml"
target: /home/${{ vars.VM_USERNAME }}/${{ github.repository }}
debug: true
- name: Copy knowledge base From Repo to VM Host
uses: appleboy/[email protected]
with:
host: ${{ vars.VM_HOST }}
username: ${{ vars.VM_USERNAME }}
key: ${{ secrets.VM_SSH_PRIVATE_KEY }}
proxy_host: ${{ vars.DEPLOYMENT_GATEWAY_HOST }}
proxy_username: ${{ vars.DEPLOYMENT_GATEWAY_USER }}
proxy_key: ${{ secrets.DEPLOYMENT_GATEWAY_SSH_KEY }}
proxy_port: ${{ vars.DEPLOYMENT_GATEWAY_PORT }}
source: "./knowledge"
target: /home/${{ vars.VM_USERNAME }}/${{ github.repository }}
- name: SSH to VM and create .env.prod
uses: appleboy/[email protected]
with:
host: ${{ vars.VM_HOST }}
username: ${{ vars.VM_USERNAME }}
key: ${{ secrets.VM_SSH_PRIVATE_KEY }}
proxy_host: ${{ vars.DEPLOYMENT_GATEWAY_HOST }}
proxy_username: ${{ vars.DEPLOYMENT_GATEWAY_USER }}
proxy_key: ${{ secrets.DEPLOYMENT_GATEWAY_SSH_KEY }}
proxy_port: ${{ vars.DEPLOYMENT_GATEWAY_PORT }}
script: |
rm /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
touch /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "EMAIL_ADDRESS=${{ secrets.EMAIL_ADDRESS }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "EMAIL_PASSWORD=${{ secrets.EMAIL_PASSWORD }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "IMAP_SERVER=${{ vars.IMAP_SERVER }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "SMTP_SERVER=${{ vars.SMTP_SERVER }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "IMAP_PORT=${{ vars.IMAP_PORT }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "SMTP_PORT=${{ vars.SMTP_PORT }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "USE_OPENAI=${{ vars.USE_OPENAI }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "USE_AZURE=${{ vars.USE_AZURE }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "GPU_USER=${{ secrets.GPU_USER }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "GPU_PASSWORD=${{ secrets.GPU_PASSWORD }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "GPU_HOST=${{ vars.GPU_HOST }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "GPU_MODEL=${{ vars.GPU_MODEL }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "GPU_URL=${{ vars.GPU_URL }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "ANGELOS_URI=${{ vars.ANGELOS_URI }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "ANGELOS_PORT=${{ vars.ANGELOS_PORT }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "OPENAI_MODEL=${{ vars.OPENAI_MODEL }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "STUDY_PROGRAMS_FOLDER=${{ vars.STUDY_PROGRAMS_FOLDER }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
echo "ANGELOS_APP_API_KEY=${{ secrets.ANGELOS_APP_API_KEY }}" >> /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod
- name: SSH to VM and Execute Docker-Compose Up
uses: appleboy/[email protected]
with:
host: ${{ vars.VM_HOST }}
username: ${{ vars.VM_USERNAME }}
key: ${{ secrets.VM_SSH_PRIVATE_KEY }}
proxy_host: ${{ vars.DEPLOYMENT_GATEWAY_HOST }}
proxy_username: ${{ vars.DEPLOYMENT_GATEWAY_USER }}
proxy_key: ${{ secrets.DEPLOYMENT_GATEWAY_SSH_KEY }}
proxy_port: ${{ vars.DEPLOYMENT_GATEWAY_PORT }}
script: |
if ! docker network inspect angelos-network >/dev/null 2>&1; then
echo "Network 'angelos-network' does not exist, creating it..."
docker network create angelos-network
fi
docker network ls
docker compose -f /home/${{ vars.VM_USERNAME }}/${{ github.repository }}/docker-compose.yml --env-file=/home/${{ vars.VM_USERNAME }}/${{ github.repository }}/.env.prod up --pull=always -d --force-recreate --remove-orphans