Skip to content

Commit

Permalink
Merge pull request #108 from lmilbaum/chatbot-workflow
Browse files Browse the repository at this point in the history
chatbot GHA workflow
  • Loading branch information
rhatdan authored Mar 28, 2024
2 parents 2892ef5 + 3b391c5 commit 944ce4b
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/chatbot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: chatbot

on:
pull_request:
branches:
- main
push:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/chatbot

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
services:
registry:
image: registry:2.8.3
ports:
- 5000:5000
steps:
- uses: actions/[email protected]

- name: Login to ghcr
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Buildah Action
uses: redhat-actions/[email protected]
with:
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: latest
containerfiles: ./chatbot/builds/Containerfile
context: chatbot

- name: Set up Python
uses: actions/[email protected]

- name: Install python dependencies
run: make -f chatbot/Makefile install

- name: Run tests
run: make -f chatbot/Makefile test
15 changes: 15 additions & 0 deletions chatbot/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.PHONY: build
build:
podman build -f chatbot/Containerfile -t ghcr.io/ai-lab-recipes/chatbot .

.PHONY: install
install:
pip install -r requirements-test.txt

.PHONY: run
run:
podman run -it -p 8501:8501 -e MODEL_SERVICE_ENDPOINT=http://10.88.0.1:8001/v1 ghcr.io/ai-lab-recipes/chatbot

.PHONY: test
test:
pytest --collect-only chatbot/tests --log-cli-level NOTSET
2 changes: 2 additions & 0 deletions chatbot/tests/test_alive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_placeholder():
assert 1 == 1

0 comments on commit 944ce4b

Please sign in to comment.