Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #126

Closed
wants to merge 50 commits into from
Closed

Test #126

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
c581e19
Create docker-image.yml
Bortus-AI Dec 3, 2023
05f8234
Update docker-image.yml
Bortus-AI Dec 3, 2023
52701da
Update docker-image.yml
Bortus-AI Dec 3, 2023
33a718e
Update docker-image.yml
Bortus-AI Dec 3, 2023
f2fab18
Update docker-image.yml
Bortus-AI Dec 3, 2023
01c041b
Update docker-image.yml
Bortus-AI Dec 3, 2023
864791c
Update docker-image.yml
Bortus-AI Dec 3, 2023
da22a83
Update docker-image.yml
Bortus-AI Dec 3, 2023
6507f34
Update docker-image.yml
Bortus-AI Dec 3, 2023
cb81acf
Update docker-image.yml
Bortus-AI Dec 3, 2023
9a3de17
Update docker-image.yml
Bortus-AI Dec 3, 2023
e37fde1
Update docker-image.yml
Bortus-AI Dec 3, 2023
2984259
Update docker-image.yml
Bortus-AI Dec 3, 2023
d9e4ab3
Update docker-image.yml
Bortus-AI Dec 3, 2023
7c7524b
Update docker-image.yml
Bortus-AI Dec 3, 2023
c319d73
Update docker-image.yml
Bortus-AI Dec 3, 2023
6534195
Update docker-image.yml
Bortus-AI Dec 3, 2023
f0e1f3d
Update docker-image.yml
Bortus-AI Dec 3, 2023
49b45f7
Update docker-image.yml
Bortus-AI Dec 3, 2023
2b6630c
Update docker-image.yml
Bortus-AI Dec 3, 2023
7d97c29
Update docker-image.yml
Bortus-AI Dec 3, 2023
5d8364b
Update docker-image.yml
Bortus-AI Dec 3, 2023
c0126e7
Update docker-image.yml
Bortus-AI Dec 3, 2023
31a377d
Update README.md
Bortus-AI Dec 4, 2023
741f73a
Merge pull request #3 from Bortus-AI/pnpm-change
Bortus-AI Dec 4, 2023
c89693a
Update docker-image.yml
Bortus-AI Dec 4, 2023
b6c76e1
Merge pull request #4 from Bortus-AI/Github-runner-change
Bortus-AI Dec 4, 2023
2f47b42
Update docker-image.yml
Bortus-AI Dec 4, 2023
516ac24
Update docker-image.yml
Bortus-AI Dec 4, 2023
d9737c1
Update docker-image.yml
Bortus-AI Dec 4, 2023
c4a04db
Update docker-image.yml
Bortus-AI Dec 4, 2023
be71042
Update docker-image.yml
Bortus-AI Dec 5, 2023
5d66606
Update docker-image.yml
Bortus-AI Dec 5, 2023
2893786
Update docker-image.yml
Bortus-AI Dec 5, 2023
eada69b
Update docker-image.yml
Bortus-AI Dec 5, 2023
3608c60
Update docker-image.yml
Bortus-AI Dec 5, 2023
517b778
Update docker-image.yml
Bortus-AI Dec 5, 2023
a7fd7b1
Update Dockerfile
Bortus-AI Dec 5, 2023
3119b82
Update Dockerfile
Bortus-AI Dec 5, 2023
6f1c89b
Update docker-image.yml
Bortus-AI Dec 5, 2023
8eb91a0
Update docker-image.yml
Bortus-AI Dec 5, 2023
7d9a9fe
Update docker-image.yml
Bortus-AI Dec 5, 2023
36a98b4
Update docker-image.yml
Bortus-AI Dec 5, 2023
d4925f7
Update docker-image.yml
Bortus-AI Dec 5, 2023
02fa1b8
Update docker-image.yml
Bortus-AI Dec 5, 2023
c97ada7
Update docker-image.yml
Bortus-AI Dec 5, 2023
806f849
Update docker-image.yml
Bortus-AI Dec 5, 2023
85e57bc
Update docker-image.yml
Bortus-AI Dec 5, 2023
8774efa
Update docker-image.yml
Bortus-AI Dec 5, 2023
87c1c35
Create test.yml
Bortus-AI Dec 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Docker Build and Push

on:
push:
branches:
- dev
pull_request:
branches:
- dev

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Create .env.local file
run: |
echo "NEXT_PUBLIC_DEFAULT_MODEL='gpt-4'" >> ./apps/unsaged/.env.local
echo "NEXT_PUBLIC_TITLE='unsaged'" >> ./apps/unsaged/.env.local
echo "NEXT_PUBLIC_DESCRIPTION='Open source chat kit engineered for seamless interaction with AI models'" >> ./apps/unsaged/.env.local
echo "NEXT_PUBLIC_DEFAULT_OPENAI_SYSTEM_PROMPT='You are ChatGPT, a large language model trained by OpenAI. Follow the user's instructi carefully. Respond using markdown.'" >> ./apps/unsaged/.env.local
echo "NEXT_PUBLIC_DEFAULT_OLLAMA_SYSTEM_PROMPT='You are a helpful AI assistant. Follow the my instructions carefully. Your responses will be automatically parsed as markdown. Do not surround your response with any language tags.'" >> ./apps/unsaged/.env.local
echo "NEXT_PUBLIC_DEFAULT_OLLAMA_TEMPERATURE='1.0'" >> ./apps/unsaged/.env.local
echo "NEXT_PUBLIC_DEFAULT_OLLAMA_TOP_P='1.0'" >> ./apps/unsaged/.env.local
echo "NEXT_PUBLIC_DEFAULT_OLLAMA_TOP_K='40'" >> ./apps/unsaged/.env.local
echo "NEXT_PUBLIC_DEFAULT_OLLAMA_REPEAT_PENALTY='1.0'" >> ./apps/unsaged/.env.local
echo "NEXT_PUBLIC_DEFAULT_OLLAMA_SEED='7'" >> ./apps/unsaged/.env.local
echo "NEXTAUTH_SECRET='${{ secrets.NEXTAUTH_SECRET }}'" >> ./apps/unsaged/.env.local
echo "NEXTAUTH_URL='https://chat.bortus.ai'" >> ./apps/unsaged/.env.local
echo "NEXT_PUBLIC_DEBUG_MODE='true'" >> ./apps/unsaged/.env.local
echo "NEXT_PUBLIC_SUPABASE_ANON_KEY='${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}'" >> ./apps/unsaged/.env.local
echo "AUTH0_CLIENT_ID='${{ secrets.AUTH0_CLIENT_ID }}'" >> ./apps/unsaged/.env.local
echo "AUTH0_CLIENT_SECRET='${{ secrets.AUTH0_CLIENT_SECRET }}'" >> ./apps/unsaged/.env.local
echo "AUTH0_ISSUER='https://dev-atz0i8gtht86so7o.us.auth0.com'" >> ./apps/unsaged/.env.local
echo "GOOGLE_CLIENT_ID='${{ secrets.GOOGLE_CLIENT_ID }}'" >> ./apps/unsaged/.env.local
echo "GOOGLE_CLIENT_SECRET='${{ secrets.GOOGLE_CLIENT_SECRET }}'" >> ./apps/unsaged/.env.local
echo "NEXT_PUBLIC_SUPABASE_URL='https://khoximvqphadhuohusah.supabase.co'" >> ./apps/unsaged/.env.local
echo "SUPABASE_JWT_SECRET='${{ secrets.SUPABASE_JWT_SECRET }}'" >> ./apps/unsaged/.env.local
echo "SUPABASE_SERVICE_ROLE_KEY='${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}'" >> ./apps/unsaged/.env.local
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
PALM_API_KEY: ${{ secrets.PALM_API_KEY }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }}
AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
SUPABASE_JWT_SECRET: ${{ secrets.SUPABASE_JWT_SECRET }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}

# Install pnpm
- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies for unsaged app
run: |
cd apps/unsaged
pnpm install
pnpm update
cd ../../

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub (or your preferred registry)
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./apps/unsaged/Dockerfile
push: true
tags: bpvarsity/unsaged:latest
cache-from: type=registry,ref=bpvarsity/unsaged:latest
cache-to: type=inline
114 changes: 114 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Build, Test and Release

on:
push:
branches:
- desktop-app
pull_request:
branches:
- desktop-app

jobs:

test:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: actions/cache@v2
with:
path: |
apps/unsaged/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/apps/unsaged/package-lock.json') }}

- name: Install dependencies
run: |
cd apps/unsaged
npm install

- name: Lint Source Code
run: |
cd apps/unsaged
npm run lint

- name: Run Tests
run: |
cd apps/unsaged
npm run test

build:

runs-on: ubuntu-latest
needs: test
steps:

- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: actions/cache@v2
with:
path: |
apps/unsaged/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/apps/unsaged/package-lock.json') }}

- name: Install dependencies
run: |
cd apps/unsaged
npm install

- name: Build Tauri App
run: |
cd apps/unsaged
npm run tauri build

release:
runs-on: ubuntu-latest
needs: build
steps:

- uses: actions/checkout@v3

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./apps/unsaged/src-tauri/target/release/bundle/nsis/unsaged_0.1.0_x64-setup.exe
asset_name: unsaged_0.1.0_x64-setup.exe
asset_content_type: application/octet-stream
6 changes: 3 additions & 3 deletions apps/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ The documentation site is built using [Docusaurus 3](https://docusaurus.io/).
## Installation

```sh
npm install
pnpm install
```

## Local Development

```sh
npm start
pnpm start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

## Build

```sh
npm build
pnpm build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
2 changes: 1 addition & 1 deletion apps/unsaged/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COPY apps/ apps/
COPY packages/ packages/

# Copy the .env.local file from the host to the specified path in the Docker container
COPY ./apps/unsaged/.env.local /unsaged/apps/unsaged/.env.local
#COPY ./apps/unsaged/.env.local /unsaged/apps/unsaged/.env.local

# ---- Dependencies ----
FROM base AS dependencies
Expand Down
Loading