Skip to content

Update PetStoreAssistantUtilities.java #40

Update PetStoreAssistantUtilities.java

Update PetStoreAssistantUtilities.java #40

name: Pet Store Assistant CI/CD to Azure App Service
env:
AZURE_CONTAINER_REGISTRY: azurepetstorecontainerregistry.azurecr.io
AZURE_CONTAINER_REGISTRY_USERNAME: azurepetstorecontainerregistry
on:
push:
branches:
- main
paths:
- petstore/petstoreassistant/**
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update the application.properties hack because the app config injection isnt working for some reason
run: echo -n -e "MicrosoftAppId=${{ secrets.ASSISTANTAPPID }}\nMicrosoftAppPassword=${{ secrets.ASSISTANTAPPPASSWORD }}\nserver.port=3978\naoai.key=${{ secrets.ASSISTANT_AOAI_KEY }}\ncognitive.search.key=${{ secrets.ASSISTANT_CS_KEY }}\ncosmos.key=${{ secrets.ASSISTANT_COSMOS_KEY }}" > petstore/petstoreassistant/src/main/resources/application.properties
- run: cat petstore/petstoreassistant/src/main/resources/application.properties
- uses: azure/docker-login@v1
name: Build Docker image
with:
login-server: ${{ env.AZURE_CONTAINER_REGISTRY }}
username: ${{ env.AZURE_CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.PETSTORECRSECRET }}
- name: Push Docker image to Azure Container Registry
run: |
docker build petstore/petstoreassistant -t ${{env.AZURE_CONTAINER_REGISTRY}}/petstoreassistant:latest -t ${{ env.AZURE_CONTAINER_REGISTRY }}/petstoreassistant:${{ github.sha }}
docker push ${{ env.AZURE_CONTAINER_REGISTRY }}/petstoreassistant:${{ github.sha }}
docker push ${{ env.AZURE_CONTAINER_REGISTRY }}/petstoreassistant:latest