|
12 | 12 | branches: |
13 | 13 | - main |
14 | 14 | paths: |
15 | | - # Verify changes to the Dockerfile on PRs |
| 15 | + # Verify changes to the Dockerfile on PRs, tainted when we update ES. |
| 16 | + - docker/docker-compose-elastic.yml |
| 17 | + - example-apps/chatbot-rag-app/docker-compose.yml |
16 | 18 | - example-apps/chatbot-rag-app/Dockerfile |
17 | 19 | - .github/workflows/docker-chatbot-rag-app.yml |
18 | 20 | - '!**/*.md' |
@@ -42,13 +44,26 @@ jobs: |
42 | 44 | registry: ghcr.io |
43 | 45 | username: ${{ github.actor }} |
44 | 46 | password: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + # This builds the image and pushes its digest if a multi-architecture |
| 48 | + # image will be made later (event_name == 'push'). As a side-effect the |
| 49 | + # layers built are in the cache and usable for testing PRs later. |
45 | 50 | - uses: docker/build-push-action@v6 |
46 | 51 | id: build |
47 | 52 | with: |
48 | 53 | context: example-apps/chatbot-rag-app |
49 | 54 | outputs: type=image,name=${{ env.IMAGE }},push-by-digest=true,name-canonical=true,push=${{ github.event_name == 'push' && 'true' || 'false' }} |
50 | 55 | cache-from: type=gha |
51 | 56 | cache-to: type=gha,mode=max |
| 57 | + - name: start elasticsearch |
| 58 | + if: github.event_name == 'pull_request' |
| 59 | + run: docker compose -f docker/docker-compose-elastic.yml up --quiet-pull -d --wait --wait-timeout 120 elasticsearch |
| 60 | + - name: test image |
| 61 | + if: github.event_name == 'pull_request' |
| 62 | + working-directory: example-apps/chatbot-rag-app |
| 63 | + run: | # This tests ELSER is working, which doesn't require an LLM. |
| 64 | + cp env.example .env |
| 65 | + docker compose build create-index |
| 66 | + time docker compose run --build --rm -T create-index |
52 | 67 | - name: export digest |
53 | 68 | if: github.event_name == 'push' |
54 | 69 | run: | |
|
0 commit comments