Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
96 changes: 90 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Employers AI
name: Deploy Software AI


on:
Expand All @@ -7,6 +7,8 @@ on:
branches:
- main

env:
NODE_VERSION: '22.x'

jobs:
build-and-deploy:
Expand Down Expand Up @@ -36,25 +38,26 @@ jobs:
rsync -avz --delete ./ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:/home/administrator/deploys/softwareai \
--exclude node_modules \
--exclude .git \
--exclude front-end/node_modules
--exclude frontend/web/node_modules
--exclude electron/web/node_modules

- name: Make dir on VPS
run: |
ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} "
mkdir -p /home/administrator/deploys/softwareai/Back-End/Keys && \
mkdir -p /home/administrator/deploys/softwareai/Front-End
mkdir -p /home/administrator/deploys/softwareai/backend/Keys && \
mkdir -p /home/administrator/deploys/softwareai/frontend/web
"

- name: Create keys.env on VPS
run: |
ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} "
printf '%s' '${{ secrets.BACK_END_ENV_KEYS }}' > /home/administrator/deploys/softwareai/Back-End/Keys/keys.env
printf '%s' '${{ secrets.BACK_END_ENV_KEYS }}' > /home/administrator/deploys/softwareai/backend/Keys/keys.env
"

- name: Create .env on VPS
run: |
ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} "
printf '%s' '${{ secrets.FRONT_END_ENV_KEYS }}' > /home/administrator/deploys/softwareai/Front-End/.env
printf '%s' '${{ secrets.FRONT_END_ENV_KEYS }}' > /home/administrator/deploys/softwareai/frontend/web/.env
"

- name: Create COMPOSE on VPS
Expand All @@ -72,3 +75,84 @@ jobs:
docker container prune && \
docker compose up --build -d --no-deps softwareai_frontend softwareai_api
"

build-electron:
name: "⚡ Build Electron App"
runs-on: windows-latest
needs: build-frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Modules
run: npm install
- name: Install Electron
run: npm install --save-dev electron@latest
- name: Download frontend/electron build
uses: actions/download-artifact@v4
with:
name: vite-dist
path: dist
- name: Copy frontend/electron to Electron
shell: bash # ⬅️ use Bash em vez de pwsh
run: |
mkdir -p public
cp -r dist/* public/
- name: Build Electron App
run: npx electron-builder --win --publish never
- uses: actions/upload-artifact@v4
with:
name: electron-app
path: dist/*.exe # ◀️ captura o instalador Windows

release:
name: "🚀 Create GitHub Release"
runs-on: ubuntu-latest
needs: build-electron
if: github.event.pull_request.merged == true
permissions:
contents: write
steps:
- name: "Checkout code (to read package.json)"
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: "Setup Node.js"
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: "Get version from package.json"
id: get_version
run: |
version=$(node -p "require('./package.json').version")
echo "version=$version" >> $GITHUB_OUTPUT

- name: "Download Electron artifact"
uses: actions/download-artifact@v4
with:
name: electron-app
path: ./release-assets

- name: Delete existing release (if any)
run: |
version=v${{ steps.get_version.outputs.version }}
gh release delete "$version" --yes || true
git push --delete origin "$version" || true

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Create GitHub Release and Upload Assets
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.get_version.outputs.version }}
name: "Release v${{ steps.get_version.outputs.version }}"
draft: false
prerelease: false
token: ${{ secrets.GH_TOKEN }}
files: |
./release-assets/**
54 changes: 50 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,58 @@
Back-End/Save/
# Local databases
smart_call_triage.db
# OS
.DS_Store
Thumbs.db

# Python
__pycache__/
*.py[cod]
*.egg-info/
.venv/
.env
ENV/

# Node
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
*.tsbuildinfo

# Build artifacts
build/
dist/
.vite/
.coverage/
coverage/
__pycache__/
*.py[cod]
*.egg-info/
.venv/
*.env
.ruff_cache/
.pytest_cache/
.coverage/
*.log
backend/Save/
mongo-init.js
Legacy/AgentsWorkFlow/
backend/Agents/gpt_engineer/keys.env
backend/WorkEnv/
backend/Modules/ChatKit/data_tools/data.py
backend/Agents/AppAI/RequirementsPlanner/Knowledge/keys.env
backend/Agents/AppAI/SprintsSheduler/Sessions/
backend/Agents/AppAI/RequirementsPlanner/save/
backend/Modules/ChatKit/Thread_Sessions/
ProductionFiles/Certifi/
ProductionFiles/keys.env
ProductionFiles/.env
backend/Agents/JobSearch/Curriculo/
backend/Agents/JobSearch/Reports/
Legacy/Keys/InternalDocs/
Back-End/Keys/
Back-End/Invoices/
backend/Keys/
backend/Invoices/
Legacy/LocalProject/
node_modules/
Tests/
Expand All @@ -16,7 +62,7 @@ __pycache__/
*.pyc
*.cpython-39.pyc
**/__pycache__/
Back-End/Keys/keys.env
backend/Keys/keys.env

# Logs
logs
Expand Down
4 changes: 0 additions & 4 deletions Back-End/.dockerignore

This file was deleted.

Loading