docker 3 #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Multilanguage Invoice OCR | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.10.12 | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install make | |
make install | |
# - name: Run bot tests | |
# run: make bot | |
- name: Run paddleocr test | |
run: python src/ocr_reader.py | |
- name: Run invoice extraction test | |
# env: | |
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
run: python src/invoice_extraction.py | |
- name: Set up Docker and MongoDB | |
run: | | |
# Run MongoDB container | |
docker run -d \ | |
--name mongodb \ | |
-v /data/test-change-streams:/data/db \ | |
-p 27017:27017 \ | |
mongo:latest \ | |
mongod --replSet test-change-streams --logpath /data/db/mongodb.log --dbpath /data/db --port 27017 | |
# Wait for MongoDB to be fully up and running | |
sleep 30 | |
# Initialize MongoDB replica set | |
docker exec mongodb mongosh --eval 'config = {_id: "test-change-streams",members: [{ _id : 0, host : "localhost:27017"}]};rs.initiate(config);' | |
# Run the API server | |
# python src/api.py |