Skip to content

Commit

Permalink
Workflow to build and deploy guided-conversation-assistant (#111)
Browse files Browse the repository at this point in the history
Also simplifies assistant workflows so they do not need to specify the
azure website name
  • Loading branch information
markwaddle authored Oct 9, 2024
1 parent bd0e008 commit d9c5bc4
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 27 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/guided-conversation-assistant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: guided-conversation assistant continuous integration

on:
pull_request:
branches: ["main"]
paths:
- "assistants/guided-conversation-assistant/**"
- "libraries/python/**"
- "tools/docker/**"
- ".github/workflows/guided-conversation-assistant.yml"

push:
branches: ["main"]
paths:
- "assistants/guided-conversation-assistant/**"
- "libraries/python/**"
- "tools/docker/**"
- ".github/workflows/guided-conversation-assistant.yml"

workflow_dispatch:

defaults:
run:
working-directory: assistants/guided-conversation-assistant

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: docker-build
run: |
make docker-build
deploy:
runs-on: ubuntu-latest
environment: production
permissions:
id-token: write # for OIDC login
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
needs: build
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' && vars.DEPLOYMENT_ENABLED == 'true' }}
env:
DOCKER_IMAGE_TAG: ${{ github.sha }}
DOCKER_REGISTRY_NAME: ${{ secrets.AZURE_CONTAINER_REGISTRY_NAME }}
AZURE_WEBSITE_RESOURCE_GROUP: ${{ secrets.AZURE_WEBSITE_RESOURCE_GROUP }}
AZURE_WEBSITE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

steps:
- uses: actions/checkout@v4

- uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: docker-push
run: |
make docker-push
- name: docker-deploy
run: |
make docker-deploy
11 changes: 3 additions & 8 deletions .github/workflows/prospector-assistant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ on:
branches: ["main"]
paths:
- "assistants/prospector-assistant/**"
- "libraries/python/semantic-workbench-api-model/**"
- "libraries/python/semantic-workbench-assistant/**"
- "libraries/python/content-safety/**"
- "libraries/python/**"
- "tools/docker/**"
- ".github/workflows/prospector-assistant.yml"

push:
branches: ["main"]
paths:
- "assistants/prospector-assistant/**"
- "libraries/python/semantic-workbench-api-model/**"
- "libraries/python/semantic-workbench-assistant/**"
- "libraries/python/content-safety/**"
- "libraries/python/**"
- "tools/docker/**"
- ".github/workflows/prospector-assistant.yml"

Expand All @@ -44,13 +40,12 @@ jobs:
id-token: write # for OIDC login
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-prospector-assistant
group: ${{ github.workflow }}-${{ github.ref }}
needs: build
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' && vars.DEPLOYMENT_ENABLED == 'true' }}
env:
DOCKER_IMAGE_TAG: ${{ github.sha }}
DOCKER_REGISTRY_NAME: ${{ secrets.AZURE_CONTAINER_REGISTRY_NAME }}
AZURE_WEBSITE_NAME: ${{ secrets.AZURE_PROSPECTOR_ASSISTANT_SERVICE_NAME }}
AZURE_WEBSITE_RESOURCE_GROUP: ${{ secrets.AZURE_WEBSITE_RESOURCE_GROUP }}
AZURE_WEBSITE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

Expand Down
19 changes: 3 additions & 16 deletions .github/workflows/skill-assistant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,15 @@ on:
branches: ["main"]
paths:
- "assistants/skill-assistant/**"
- "libraries/python/semantic-workbench-api-model/**"
- "libraries/python/semantic-workbench-assistant/**"
- "libraries/python/content-safety/**"
- "libraries/python/chat-driver/**"
- "libraries/python/context/**"
- "libraries/python/events/**"
- "libraries/python/skills/**"
- "libraries/python/**"
- "tools/docker/**"
- ".github/workflows/skill-assistant.yml"

push:
branches: ["main"]
paths:
- "assistants/skill-assistant/**"
- "libraries/python/semantic-workbench-api-model/**"
- "libraries/python/semantic-workbench-assistant/**"
- "libraries/python/content-safety/**"
- "libraries/python/chat-driver/**"
- "libraries/python/context/**"
- "libraries/python/events/**"
- "libraries/python/skills/**"
- "libraries/python/**"
- "tools/docker/**"
- ".github/workflows/skill-assistant.yml"

Expand All @@ -52,13 +40,12 @@ jobs:
id-token: write # for OIDC login
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-skill-assistant
group: ${{ github.workflow }}-${{ github.ref }}
needs: build
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' && vars.DEPLOYMENT_ENABLED == 'true' }}
env:
DOCKER_IMAGE_TAG: ${{ github.sha }}
DOCKER_REGISTRY_NAME: ${{ secrets.AZURE_CONTAINER_REGISTRY_NAME }}
AZURE_WEBSITE_NAME: ${{ secrets.AZURE_SKILL_ASSISTANT_SERVICE_NAME }}
AZURE_WEBSITE_RESOURCE_GROUP: ${{ secrets.AZURE_WEBSITE_RESOURCE_GROUP }}
AZURE_WEBSITE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workbench-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
id-token: write # for OIDC login
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-workbench
group: ${{ github.workflow }}-${{ github.ref }}
needs: [build, test]
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' && vars.DEPLOYMENT_ENABLED == 'true' }}
env:
Expand Down
2 changes: 1 addition & 1 deletion assistants/guided-conversation-assistant/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "assistant"
version = "0.1.0"
description = "Demonstrates how to guide a user towards a goal using the guided-conversation library."
description = "An assistant that will guide users through a conversation towards a specific goal."
authors = [{ name = "Semantic Workbench Team" }]
readme = "README.md"
requires-python = ">=3.11"
Expand Down
1 change: 0 additions & 1 deletion libraries/python/assistant-drive/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
repo_root = $(shell git rev-parse --show-toplevel)
include $(repo_root)/tools/makefiles/python.mk
include $(repo_root)/tools/makefiles/docker-assistant.mk
2 changes: 2 additions & 0 deletions tools/makefiles/docker-assistant.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ DOCKER_FILE = $(repo_root)/tools/docker/Dockerfile.assistant
DOCKER_BUILD_ARGS = app=$(ASSISTANT_APP) package=$(ASSISTANT_PACKAGE)
DOCKER_IMAGE_NAME = $(ASSISTANT_IMAGE_NAME)

AZURE_WEBSITE_NAME ?= $(ASSISTANT_PACKAGE)-service

include $(this_dir)/docker.mk


Expand Down

0 comments on commit d9c5bc4

Please sign in to comment.