forked from freelawproject/eyecite
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (33 loc) · 1.03 KB
/
Copy pathdocker-api.yml
File metadata and controls
42 lines (33 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Build and Test eyecite API Docker
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
run: docker build -t eyecite-api .
- name: Run Docker container
run: |
docker run -d -p 8000:8000 --name eyecite-api-test eyecite-api
sleep 10
- name: Test /extract endpoint
run: |
curl -X POST "http://localhost:8000/extract" \
-H "Content-Type: application/json" \
-d '{"text": "See 410 U.S. 113 (1973)."}'
- name: Show container logs on failure
if: failure()
run: docker logs eyecite-api-test
- name: Stop container
if: always()
run: docker stop eyecite-api-test && docker rm eyecite-api-test