Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
4cda8c2
Generate DB password and write it to keyVault. Use this value when bu…
katerynaZh Jul 27, 2025
0e76477
fix typo and format
katerynaZh Jul 27, 2025
b0de721
add login to azure, before get ky vault value
katerynaZh Jul 27, 2025
e3500a0
Change dependencies, as we need key vault exists when docker imageis …
katerynaZh Jul 27, 2025
32ca7c9
add trigger so actions is run automatically
katerynaZh Jul 27, 2025
9008835
update brunch name in triggers
katerynaZh Jul 27, 2025
21ef128
fix key vault AZURE-POSTGRESQL-ADMIN-PASSWORD name
katerynaZh Jul 27, 2025
c2ac88a
try fix build docker image
katerynaZh Jul 27, 2025
58017cc
store db password in key vault, only if db was create from scratch
katerynaZh Jul 27, 2025
1721987
add VNET
YuriiBerezan Jul 29, 2025
bd1e7e3
add VNET
YuriiBerezan Jul 29, 2025
d0f8165
change address_prefix
YuriiBerezan Jul 29, 2025
97ae31c
fixed vnet-integration
YuriiBerezan Jul 29, 2025
9e6e742
change create to add
YuriiBerezan Jul 29, 2025
6c9351c
fixed
YuriiBerezan Jul 29, 2025
3f03c6d
delete no wait
YuriiBerezan Jul 29, 2025
6d4e1ee
fixed
YuriiBerezan Jul 29, 2025
b478b3c
fixd create vnet
YuriiBerezan Jul 29, 2025
80163e7
fixed
YuriiBerezan Aug 4, 2025
757ecc1
add ""
YuriiBerezan Aug 4, 2025
b1341cd
change ""
YuriiBerezan Aug 4, 2025
3e6745b
add yes
YuriiBerezan Aug 4, 2025
1daf7b7
update CI/CD workflow for improved resource deployment
ViktorDronov Aug 6, 2025
2c653a4
add CreateNSGRule action and integrate into CI/CD workflow for NSG ma…
ViktorDronov Aug 6, 2025
10682d5
added shell in the action
ViktorDronov Aug 7, 2025
85c29a9
rule name updated
ViktorDronov Aug 7, 2025
65e67ca
prio fixup
ViktorDronov Aug 7, 2025
7c28ba0
updated nsg rule names
ViktorDronov Aug 7, 2025
921f6b7
add CreateDockerImage action and integrate into CI/CD workflow for bu…
YuriiBerezan Aug 7, 2025
d83200a
Merge branch 'feature/password_in_keyvault' of https://github.com/Yur…
YuriiBerezan Aug 7, 2025
58832a0
fix: standardize formatting for Azure location and NSG rule parameter…
YuriiBerezan Aug 7, 2025
50f6efe
no need any additional ports for be and db
ViktorDronov Aug 7, 2025
213c55c
Merge branch 'feature/password_in_keyvault' of https://github.com/Yur…
ViktorDronov Aug 7, 2025
f13309e
refactor: remove redundant subnet creation logic in CI/CD workflow
ViktorDronov Aug 7, 2025
5dbfb08
feat: add CreateWebApp action for deploying Azure Web Apps with VNet …
YuriiBerezan Aug 12, 2025
55c1884
Merge branch 'feature/password_in_keyvault' of https://github.com/Yur…
YuriiBerezan Aug 12, 2025
1f3bbb8
feat: update CreateWebApp action to use lowercased container image na…
YuriiBerezan Aug 13, 2025
e090305
fix: add missing conditional closure for backend app creation in CI/C…
YuriiBerezan Aug 13, 2025
db199dd
feat: add code checkout step before Azure login in deploy_web_apps job
YuriiBerezan Aug 13, 2025
42d1b10
fix: update backend app settings with hardcoded PostgreSQL password f…
YuriiBerezan Aug 13, 2025
b73f63e
fix: update WEBAPP_SETTINGS syntax for backend and frontend app creation
YuriiBerezan Aug 13, 2025
ca71925
fix: update Docker build arguments for backend app in CI/CD workflow
YuriiBerezan Aug 14, 2025
7c938ae
fix: correct string interpolation syntax for docker_args in action.yaml
YuriiBerezan Aug 14, 2025
4beff7a
fix: correct syntax for accessing build args in Docker build command
YuriiBerezan Aug 14, 2025
550ef9e
fix: add check for empty build arguments in Docker build step
YuriiBerezan Aug 14, 2025
1f4d292
fix: remove extraneous quotation mark in docker push command
YuriiBerezan Aug 14, 2025
b23487f
fix: correct regex for matching environment variable format in action…
YuriiBerezan Aug 14, 2025
75cdcbd
fix: add managed identity permissions for BackendApp and update WEBAP…
ViktorDronov Aug 26, 2025
51098d3
fix: update echo statements to include web app name for clarity
ViktorDronov Aug 26, 2025
5af3022
fix: update BackendApp managed identity permissions to use secret for…
ViktorDronov Aug 26, 2025
5be2812
fix: update BackendApp managed identity permissions to use dynamic we…
ViktorDronov Aug 26, 2025
cc691f3
fix: update scope for BackendApp managed identity permissions to use …
ViktorDronov Aug 26, 2025
6d7d533
fix: add managed identity assignment for web app creation
ViktorDronov Aug 27, 2025
3992501
fix: add inputs for VNet and Subnet names and implement NSG linking t…
YuriiBerezan Aug 27, 2025
2b21a16
Merge branch 'feature/password_in_keyvault' of https://github.com/Yur…
YuriiBerezan Aug 27, 2025
a166910
fix: update subnet names for backend and database NSGs in CI/CD workflow
YuriiBerezan Aug 27, 2025
b61fe2f
fix: update VNet creation step and add private endpoint for Key Vault
ViktorDronov Aug 28, 2025
c982a14
fix: update CI/CD workflow for improved resource deployment
ViktorDronov Aug 28, 2025
bd73018
fix: update CI/CD workflow for improved resource deployment
ViktorDronov Aug 28, 2025
714e0b6
fix: update Key Vault private endpoint creation script for improved r…
ViktorDronov Aug 28, 2025
6313796
fix: add check for existing private DNS zone before creation for Key …
ViktorDronov Aug 28, 2025
af6c9f0
DEBUG
ViktorDronov Aug 28, 2025
4d426ea
debug
ViktorDronov Aug 28, 2025
c74751f
location added
ViktorDronov Aug 28, 2025
9db3086
more places with location
ViktorDronov Aug 28, 2025
8465b38
fix: streamline Key Vault role assignment and DNS zone creation in CI…
ViktorDronov Aug 29, 2025
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
62 changes: 62 additions & 0 deletions .github/actions/CreateDockerImage/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Create Docker Image NSG
description: |
'Builds a Docker image in the repository'
inputs:
docker_password:
required: true
description: "Docker password"
docker_username:
required: true
description: "Docker username"
docker_owner:
required: true
description: "Docker owner"
docker_args:
description: "Docker build arguments" # e.g. "FOO=bar BAZ=qux"
required: false
default: ""
tag:
description: "v1.0.0"
required: false
default: "latest"
image_name:
description: "Name of the Docker image"
required: true
source_path:
description: "Path to the Dockerfile"
required: true

runs:
using: "composite"
steps:
- name: Build args function
shell: pwsh
id: build_args
run: |
echo "Building args for docker build"
$input_args = '${{ inputs.docker_args }}' # e.g. "FOO=bar BAZ=qux"
$arr_ = @()
foreach ($input_arg in $input_args -split '\s+') {
if (-not [string]::IsNullOrWhiteSpace($input_arg)) {
$arr_ += "--build-arg $input_arg"
}
}
$joinedArgs = $arr_ -join ' ' # single space-separated string
echo "args=$joinedArgs" >> $env:GITHUB_OUTPUT

- name: Build docker images and push it to GitHub Container Registry
shell: bash
run: |
echo "Log in to GitHub Container Registry"
echo "${{ inputs.docker_password }}" | docker login ghcr.io -u "${{ inputs.docker_username }}" --password-stdin
REPO_OWNER_LOWER=$(echo "${{ inputs.docker_owner }}" | tr '[:upper:]' '[:lower:]')

echo "Build ${{ inputs.image_name }} docker image"
docker build \
${{ steps.build_args.outputs.args }} \
-t ghcr.io/$REPO_OWNER_LOWER/${{ inputs.image_name }}:${{ inputs.tag }} \
"${{ inputs.source_path }}"

echo "Docker image built successfully"
echo "Push ${{ inputs.image_name }} docker image to GitHub Container Registry"
docker push ghcr.io/$REPO_OWNER_LOWER/${{ inputs.image_name }}:${{ inputs.tag }}
89 changes: 89 additions & 0 deletions .github/actions/CreateNSGRule/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Create NSG Rule

inputs:
AZURE_RESOURCE_GROUP:
description: "Azure Resource Group Name"
required: true
type: string
AZURE_NSG_NAME:
description: "Azure NSG Name"
required: true
type: string
AZURE_LOCATION:
description: "Azure Location"
required: true
type: string
AZURE_VNET_NAME:
description: "Azure VNet Name"
required: true
type: string
AZURE_SUBNET_NAME:
description: "Azure Subnet Name"
required: true
type: string
NSG_RULE_NAME:
description: "Azure NSG Rule Name"
required: false
type: string
default: "AllowTraffic"
ALLOWED_PORTS:
description: "Comma-separated list of allowed ports"
required: false
type: string
default: ""

runs:
using: composite
steps:
- name: Create ${{ inputs.AZURE_NSG_NAME }} NSG Rule Port
shell: bash
run: |
echo "Checking if '${{ inputs.AZURE_NSG_NAME }}' NSG for VNet exists..."
if az network nsg show --name ${{ inputs.AZURE_NSG_NAME }} --resource-group ${{ inputs.AZURE_RESOURCE_GROUP }}; then
echo "NSG already exists."
else
echo "Creating NSG for VNet..."
az network nsg create \
--name ${{ inputs.AZURE_NSG_NAME }} \
--resource-group ${{ inputs.AZURE_RESOURCE_GROUP }} \
--location ${{ inputs.AZURE_LOCATION }}
fi

PORTS=$(echo ${{ inputs.ALLOWED_PORTS }} | tr ',' ' ')
PRIO=1000
for PORT in $PORTS; do
echo "Checking if NSG rule for port $PORT exists..."
if az network nsg rule show --nsg-name ${{ inputs.AZURE_NSG_NAME }} --resource-group ${{ inputs.AZURE_RESOURCE_GROUP }} --name "${{ inputs.NSG_RULE_NAME}}-$PORT-pr-$PRIO"; then
echo "NSG rule for port $PORT already exists."
else
echo "Creating NSG rule for port $PORT..."
az network nsg rule create \
--nsg-name ${{ inputs.AZURE_NSG_NAME }} \
--resource-group ${{ inputs.AZURE_RESOURCE_GROUP }} \
--name ${{ inputs.NSG_RULE_NAME}}-$PORT-pr-$PRIO \
--priority $PRIO \
--direction Inbound \
--access Allow \
--protocol Tcp \
--source-address-prefixes '*' \
--source-port-ranges '*' \
--destination-address-prefixes '*' \
--destination-port-ranges $PORT
fi
PRIO=$((PRIO + 100))
done

- name: Assign NSG to Subnet
shell: bash
run: |
echo "Checking if '${{ inputs.AZURE_NSG_NAME }}' NSG is linked to subnet..."
SUBNET_ID=$(az network vnet subnet show --resource-group ${{ inputs.AZURE_RESOURCE_GROUP }} --vnet-name ${{ inputs.AZURE_VNET_NAME }} --name ${{ inputs.AZURE_SUBNET_NAME }} --query id --output tsv)
if az network vnet subnet show --ids $SUBNET_ID --query networkSecurityGroup.id --output tsv | grep -q ${{ inputs.AZURE_NSG_NAME }}; then
echo "NSG is already linked to the subnet."
else
echo "Linking NSG to subnet..."
az network vnet subnet update \
--resource-group ${{ inputs.AZURE_RESOURCE_GROUP }} \
--ids $SUBNET_ID \
--network-security-group ${{ inputs.AZURE_NSG_NAME }}
fi
82 changes: 82 additions & 0 deletions .github/actions/CreateWebAPP/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Create WebApp

inputs:
WEBAPP_NAME:
description: "Name of the web app"
required: true
type: string
AZURE_APP_SERVICE_PLAN_NAME:
description: "Azure App Service Plan name"
required: true
type: string
AZURE_RESOURCE_GROUP:
description: "Azure Resource Group Name"
required: true
type: string
WEBAPP_VNET_NAME:
description: "Azure Virtual Network Name"
required: true
type: string
WEBAPP_SUBNET:
description: "Azure Subnet Name for the web app"
required: true
type: string
CONTAINER_IMAGE_NAME:
description: "Container image name in GitHub Container Registry"
required: true
type: string
WEBAPP_SETTINGS:
description: "Environment variables for the web app in key=value format(space separated)"
required: false
type: string
default: ""
ENABLE_APP_IDENTITY:
description: Enable Managed Identity for the web app
required: false
type: boolean
default: false

runs:
using: composite
steps:
- name: Create WebApp
shell: pwsh
run: |
$CONTAINER_IMAGE_NAME="${{ inputs.CONTAINER_IMAGE_NAME }}".tolower()
echo "Creating ${{ inputs.WEBAPP_NAME }} Web App..."
az webapp create `
--name ${{ inputs.WEBAPP_NAME }} `
--resource-group ${{ inputs.AZURE_RESOURCE_GROUP }} `
--plan ${{ inputs.AZURE_APP_SERVICE_PLAN_NAME }} `
--container-registry-url ghcr.io `
--container-image-name $CONTAINER_IMAGE_NAME

if ("${{ inputs.ENABLE_APP_IDENTITY }}" -eq "true") {
echo "Enable Managed Identity for ${{ inputs.WEBAPP_NAME }} web app"
az webapp identity assign `
--name ${{ inputs.WEBAPP_NAME }} `
--resource-group ${{ inputs.AZURE_RESOURCE_GROUP }}
}

if ('${{ inputs.WEBAPP_SETTINGS }}' -match '^(\w+="[^"]+" ?)+$') {
echo "Set environment variables for ${{ inputs.WEBAPP_NAME }}"
az webapp config appsettings set `
--name ${{ inputs.WEBAPP_NAME }} `
--resource-group ${{ inputs.AZURE_RESOURCE_GROUP }} `
--settings ${{ inputs.WEBAPP_SETTINGS }}
} else {
echo "No environment variables to set."
}

echo "Enable logging for ${{ inputs.WEBAPP_NAME }} web app"
az webapp log config `
--resource-group ${{ inputs.AZURE_RESOURCE_GROUP }} `
--name ${{ inputs.WEBAPP_NAME }} `
--docker-container-logging filesystem

echo "VNet integration for ${{ inputs.WEBAPP_NAME }} web app"
az webapp vnet-integration add `
--name ${{ inputs.WEBAPP_NAME }} `
--resource-group ${{ inputs.AZURE_RESOURCE_GROUP }} `
--vnet "${{ inputs.WEBAPP_VNET_NAME }}" `
--subnet "${{ inputs.WEBAPP_SUBNET }}"
Loading