Skip to content

Commit

Permalink
Testing & UI improvments (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
truskovskiyk authored Jan 23, 2025
1 parent 0c41325 commit c530dbe
Show file tree
Hide file tree
Showing 17 changed files with 855 additions and 649 deletions.
43 changes: 42 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
pull_request:
branches:
- main
release:
types: [published]

jobs:
docker-build:
Expand Down Expand Up @@ -71,4 +73,43 @@ jobs:
- name: Deploy API
run: railway redeploy --service no-ocr-api --yes
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}

docker-build-release:
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push docker image UI with release tag
uses: docker/build-push-action@v6
with:
context: no-ocr-ui
push: true
tags: ghcr.io/kyryl-opens-ml/no-ocr-ui:${{ github.event.release.tag_name }}
build-args: |
VITE_SUPABASE_URL=${{ secrets.VITE_SUPABASE_URL }}
VITE_SUPABASE_ANON_KEY=${{ secrets.VITE_SUPABASE_ANON_KEY }}
VITE_REACT_APP_API_URI=${{ secrets.VITE_REACT_APP_API_URI }}
cache-from: type=registry,ref=ghcr.io/kyryl-opens-ml/no-ocr-ui:buildcache
cache-to: type=registry,ref=ghcr.io/kyryl-opens-ml/no-ocr-ui:buildcache,mode=max

- name: Build and push docker image API with release tag
uses: docker/build-push-action@v6
with:
context: no-ocr-api
push: true
tags: ghcr.io/kyryl-opens-ml/no-ocr-api:${{ github.event.release.tag_name }}
cache-from: type=registry,ref=ghcr.io/kyryl-opens-ml/no-ocr-api:buildcache
cache-to: type=registry,ref=ghcr.io/kyryl-opens-ml/no-ocr-api:buildcache,mode=max
2 changes: 2 additions & 0 deletions no-ocr-api/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
data/AI-Index-Report-2024.pdf filter=lfs diff=lfs merge=lfs -text
data/InfraRed-Report.pdf filter=lfs diff=lfs merge=lfs -text
2 changes: 1 addition & 1 deletion no-ocr-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ RUN pip install -r requirements.txt
COPY . .
ENV PYTHONPATH /app/

CMD fastapi run --host 0.0.0.0 --port 8000 --workers 1 api.py
CMD fastapi run --host 0.0.0.0 --port 8000 --workers 1 np_ocr/api.py
Loading

0 comments on commit c530dbe

Please sign in to comment.