Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to Azure Container Registry
- name: Log in to Azure Container Registry - External Registry
if: ${{ github.ref_name == 'main' }}
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.ACR_LOGIN_SERVER }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Log in to Azure Container Registry (Dev/Demo/Dependabotchanges)
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'dependabotchanges' }}
- name: Log in to Azure Container Registry (Main/Dev/Demo/Dependabotchanges) - Internal Registry
if: ${{ github.ref_name == 'main' ||github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'dependabotchanges' }}
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.ACR_DEV_LOGIN_SERVER }}
Expand All @@ -46,7 +46,13 @@ jobs:

- name: Get registry
id: registry
run: echo "registry=${{ github.ref_name == 'main' && secrets.ACR_LOGIN_SERVER || secrets.ACR_DEV_LOGIN_SERVER }}" >> $GITHUB_OUTPUT
run: |
if [[ "${{ github.ref_name }}" == "main" ]]; then
echo "ext_registry=${{ secrets.ACR_LOGIN_SERVER }}" >> $GITHUB_OUTPUT
echo "int_registry=${{ secrets.ACR_DEV_LOGIN_SERVER }}" >> $GITHUB_OUTPUT
else
echo "int_registry=${{ secrets.ACR_DEV_LOGIN_SERVER }}" >> $GITHUB_OUTPUT
fi

- name: Determine Tag Name Based on Branch
id: determine_tag
Expand All @@ -61,15 +67,26 @@ jobs:
echo "tagname=dependabotchanges" >> $GITHUB_OUTPUT
else
echo "tagname=default" >> $GITHUB_OUTPUT

fi

- name: Build Docker Image and optionally push
- name: Build Docker Image and optionally push - Internal Registry
uses: docker/build-push-action@v6
with:
context: .
file: WebApp.Dockerfile
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'dependabotchanges' }}
tags: |
${{ steps.registry.outputs.registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}
${{ steps.registry.outputs.registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }}
${{ steps.registry.outputs.int_registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}
${{ steps.registry.outputs.int_registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }}

- name: Build Docker Image and optionally push - External Registry
if: ${{ github.ref_name == 'main' }}
uses: docker/build-push-action@v6
with:
context: .
file: WebApp.Dockerfile
push: ${{github.ref_name == 'main' }}
tags: |
${{ steps.registry.outputs.ext_registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}
${{ steps.registry.outputs.ext_registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }}

2 changes: 1 addition & 1 deletion infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ param AzureOpenAIStopSequence string = '\n'
@description('Whether or not to stream responses from Azure OpenAI? True or False.')
param AzureOpenAIStream bool = true

var WebAppImageName = 'DOCKER|acrbyocga.azurecr.io/webapp:latest'
var WebAppImageName = 'DOCKER|byocgacontainerreg.azurecr.io/webapp:latest'
var cosmosdb_database_name = 'db_conversation_history'
var cosmosdb_container_name = 'conversations'
var roleDefinitionId = '00000000-0000-0000-0000-000000000002'
Expand Down
15 changes: 13 additions & 2 deletions infra/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,25 @@
"_generator": {
"name": "bicep",
"version": "0.33.93.31351",
"templateHash": "896617532796464630"
"templateHash": "7005910716688710298"
}
},
"parameters": {
"environmentName": {
"type": "string",
"minLength": 3,
"maxLength": 10,
"metadata": {
"description": "A unique prefix for all resources in this deployment. This should be 3-10 characters long:"
}
},
"HostingPlanName": {
"type": "string",
"defaultValue": "[guid(resourceGroup().id)]",
"metadata": {
"azd": {
"type": "location"
},
"description": "Name of App Service plan"
}
},
Expand Down Expand Up @@ -263,7 +274,7 @@
}
},
"variables": {
"WebAppImageName": "DOCKER|acrbyocga.azurecr.io/webapp:latest",
"WebAppImageName": "DOCKER|byocgacontainerreg.azurecr.io/webapp:latest",
"cosmosdb_database_name": "db_conversation_history",
"cosmosdb_container_name": "conversations",
"roleDefinitionId": "00000000-0000-0000-0000-000000000002",
Expand Down
Loading