Skip to content

Commit

Permalink
Refactor ie-bank-infra.yml to add UAT deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
alguadam committed Oct 11, 2024
1 parent b0fdebe commit 45bfc2b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
30 changes: 29 additions & 1 deletion .github/workflows/ie-bank-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
RESOURCE_GROUP_DEV: BCSAI2024-DEVOPS-PROFESSORS
RESOURCE_GROUP_UAT: BCSAI2024-DEVOPS-PROFESSORS
SUBSCRIPTION_ID_DEV: e0b9cada-61bc-4b5a-bd7a-52c606726b3b
USER_ALIAS: aguadamillas

Expand Down Expand Up @@ -48,4 +49,31 @@ jobs:
resourceGroupName: ${{ env.RESOURCE_GROUP_DEV }}
template: ./main.bicep
parameters: ./parameters/dev.parameters.json appServiceAPIEnvVarENV=${{ vars.ENV }} appServiceAPIEnvVarDBHOST=${{ vars.DBHOST }} appServiceAPIEnvVarDBNAME=${{ vars.DBNAME }} appServiceAPIEnvVarDBPASS=${{ secrets.DBPASS }} appServiceAPIDBHostDBUSER=${{ secrets.DBUSER }} appServiceAPIDBHostFLASK_APP=${{ vars.FLASK_APP }} appServiceAPIDBHostFLASK_DEBUG=${{ vars.FLASK_DEBUG }}
deploymentName: ${{ env.USER_ALIAS }}
deploymentName: ${{ env.USER_ALIAS }}

deploy-uat:
# if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
needs: build
environment:
name: 'UAT'

steps:

# Checkout code
- uses: actions/checkout@main

# Log into Azure
- uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

# Deploy Bicep file
- name: deploy
uses: azure/arm-deploy@v2
with:
subscriptionId: ${{ env.SUBSCRIPTION_ID_DEV }}
resourceGroupName: ${{ env.RESOURCE_GROUP_DEV }}
template: ./main.bicep
parameters: ./parameters/uat.parameters.json appServiceAPIEnvVarENV=${{ vars.ENV }} appServiceAPIEnvVarDBHOST=${{ vars.DBHOST }} appServiceAPIEnvVarDBNAME=${{ vars.DBNAME }} appServiceAPIEnvVarDBPASS=${{ secrets.DBPASS }} appServiceAPIDBHostDBUSER=${{ secrets.DBUSER }} appServiceAPIDBHostFLASK_APP=${{ vars.FLASK_APP }} appServiceAPIDBHostFLASK_DEBUG=${{ vars.FLASK_DEBUG }}
deploymentName: ${{ env.USER_ALIAS }}
27 changes: 27 additions & 0 deletions parameters/uat.parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"environmentType": {
"value": "nonprod"
},
"postgreSQLServerName": {
"value": "aguadamillas-dbsrv-uat"
},
"postgreSQLDatabaseName": {
"value": "aguadamillas-db-uat"
},
"appServicePlanName": {
"value": "aguadamillas-asp-uat"
},
"appServiceAPIAppName": {
"value": "aguadamillas-be-uat"
},
"appServiceAppName": {
"value": "aguadamillas-fe-uat"
},
"location": {
"value": "North Europe"
}
}
}

0 comments on commit 45bfc2b

Please sign in to comment.