Skip to content

#13 Add similarity score to the /similarity API to help debug open so… #34

#13 Add similarity score to the /similarity API to help debug open so…

#13 Add similarity score to the /similarity API to help debug open so… #34

Workflow file for this run

name: ACMI Collection Chat CI
on: [push]
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_REPOSITORY: acmilabs/collection-chat
DOCKER_IMAGE_TAG: ${{ github.sha }}
AZURE_WEBAPP_NAME: "collection-chat-appservice"
jobs:
build-chat:
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.4.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- name: Build standard image (cached)
if: success()
uses: whoan/docker-build-with-cache-action@v4
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
image_name: "${{ env.DOCKER_REPOSITORY }}"
image_tag: "${{ env.DOCKER_IMAGE_TAG }}"
build_extra_args: "--compress=true"
push_git_tag: true
- name: cancel entire action if failed
if: failure()
uses: andymckay/cancel-action@0.2
build-and-test-python:
needs: [build-chat]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Python lint and test
run: |
cp config.tmpl.env config.env
cd development && docker-compose -f docker-compose.yml up --build -d
- name: Run Python lint and test
run: docker exec chat make linttest
- name: cancel entire action if failed
if: failure()
uses: andymckay/cancel-action@0.2
build-chat-latest:
if: github.ref == 'refs/heads/main'
needs: [build-and-test-python]
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.4.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- name: Build the latest image for production (cached)
if: success()
uses: whoan/docker-build-with-cache-action@v5
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
image_name: "${{ env.DOCKER_REPOSITORY }}"
image_tag: "latest"
build_extra_args: "--compress=true"
push_git_tag: true
- name: cancel entire action if failed
if: failure()
uses: andymckay/cancel-action@0.2
deploy:
needs: [build-and-test-python, build-chat-latest]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Azure authentication
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: ACR authentication
uses: azure/docker-login@v1
with:
login-server: ${{ env.DOCKER_REPOSITORY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: 'Deploy to Azure Web App for Container'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
images: ${{ env.DOCKER_REPOSITORY }}:latest