Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
adding new workflow for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mertbozkir committed Jun 25, 2023
1 parent 793b628 commit 63fca29
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 1 deletion.
75 changes: 75 additions & 0 deletions .github/workflows/ec2-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: ec2-deployment

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE_API_ENV: ${{ vars.PINECONE_API_ENV }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
INDEX_NAME: ${{ vars.INDEX_NAME}}
SSH_PRIVATE_KEY: ${ { secrets.EC2_SSH_KEY }}
REMOTE_HOST: ${ { secrets.HOST_DNS }}
REMOTE_USER: ${ { secrets.USERNAME }}
# TARGET: ${ { secrets.TARGET_DIR }}
mode: production

jobs:
build:
strategy:
fail-fast: false
max-parallel: 2
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.10", "3.11" ]

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} on ${{matrix.os}}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
#make install
make install-tests
- name: Lint with flake8
run: |
python -m pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install test dependencies
run: |
python -m pip install pytest
- name: Run tests
run: |
make test
docker:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build Dockerfile
run: |
docker build -t os-chat .
1 change: 1 addition & 0 deletions public/bot.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<path d="M4 4.915a1.5 1.5 0 1 0-1 0v7.355a2 2 0 0 0-1 1.728v7.004c0 .736.403 1.382 1 1.729v1.319A6.945 6.945 0 0 0 9.95 31h12.1A6.943 6.943 0 0 0 29 24.06v-1.39c.597-.347 1-.994 1-1.73v-7.01c0-.736-.403-1.383-1-1.73V5.018a1.55 1.55 0 1 0-1 0v3.396A7.017 7.017 0 0 0 21.98 5h-1.065A1.5 1.5 0 0 0 19.5 3h-7a1.5 1.5 0 0 0-1.415 2H10.03C7.47 5 5.23 6.369 4 8.414v-3.5Zm1 7.115A5.03 5.03 0 0 1 10.03 7h11.95A5.028 5.028 0 0 1 27 12.03v12.03A4.943 4.943 0 0 1 22.05 29H9.95A4.945 4.945 0 0 1 5 24.05V12.03Z"/>
</g>
</svg>
Chatbot:
</div>
<div class="message">{{MSG}}</div>
</div>
3 changes: 2 additions & 1 deletion public/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<path d="M168 96H88a40 40 0 0 0-40 40v8a40 40 0 0 0 40 40h80a40 40 0 0 0 40-40v-8a40 40 0 0 0-40-40Zm24 48a24 24 0 0 1-24 24H88a24 24 0 0 1-24-24v-8a24 24 0 0 1 24-24h80a24 24 0 0 1 24 24Zm16-112a32.06 32.06 0 0 0-31 24H79a32 32 0 0 0-63 8v80a72.08 72.08 0 0 0 72 72h80a72.08 72.08 0 0 0 72-72V64a32 32 0 0 0-32-32Zm16 112a56.06 56.06 0 0 1-56 56H88a56.06 56.06 0 0 1-56-56V64a16 16 0 0 1 32 0a8 8 0 0 0 8 8h112a8 8 0 0 0 8-8a16 16 0 0 1 32 0Zm-120-4a12 12 0 1 1-12-12a12 12 0 0 1 12 12Zm72 0a12 12 0 1 1-12-12a12 12 0 0 1 12 12Z"
fill="white"/>
</svg>
Download SVG
<!-- Download SVG -->
User:
</div>
<div class="message">{{MSG}}</div>
</div>

0 comments on commit 63fca29

Please sign in to comment.