From fc63e6d5cb35062207d4cfe733532b13166cb22f Mon Sep 17 00:00:00 2001 From: katerynaZh Date: Mon, 30 Jun 2025 21:39:20 +0200 Subject: [PATCH 1/6] add --yes --- .github/workflows/pgdb-create.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pgdb-create.yaml b/.github/workflows/pgdb-create.yaml index 51c8d6f..0834dee 100644 --- a/.github/workflows/pgdb-create.yaml +++ b/.github/workflows/pgdb-create.yaml @@ -45,6 +45,7 @@ jobs: --sku-name Standard_B1ms \ --storage-size 32 \ --version 16 + --yes # --public-access 13.82.232.186 # echo "Add Firewall Rule" From 2fcbce37b5fc915f9f30daa31961b68d3a3282dd Mon Sep 17 00:00:00 2001 From: katerynaZh Date: Mon, 30 Jun 2025 21:40:09 +0200 Subject: [PATCH 2/6] update trigger --- .github/workflows/pgdb-create.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pgdb-create.yaml b/.github/workflows/pgdb-create.yaml index 0834dee..7310f03 100644 --- a/.github/workflows/pgdb-create.yaml +++ b/.github/workflows/pgdb-create.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + - feature/pipelines permissions: id-token: write # ОБОВ'ЯЗКОВО для OIDC логіну From a8ddb173d165c37fc9f90ccab0072a2177725d08 Mon Sep 17 00:00:00 2001 From: katerynaZh Date: Mon, 30 Jun 2025 21:45:38 +0200 Subject: [PATCH 3/6] latest update --- .github/workflows/pgdb-create.yaml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pgdb-create.yaml b/.github/workflows/pgdb-create.yaml index 7310f03..5f8229a 100644 --- a/.github/workflows/pgdb-create.yaml +++ b/.github/workflows/pgdb-create.yaml @@ -4,7 +4,7 @@ on: push: branches: - main - - feature/pipelines + - feature/pipelines # Додано для запуску з гілки feature/pipelines, видалити у фінальній версії permissions: id-token: write # ОБОВ'ЯЗКОВО для OIDC логіну @@ -28,14 +28,12 @@ jobs: subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} - name: Deploy PG Flexible Server - run: | - echo "Generate Random PostgreSQL Server Name" - PGDB_NAME="pg-rest-api-westeurope" - - # echo "Get Runner Public IP" - # IP=$(curl -s https://ifconfig.me) - + run: | + IP=$(curl -s https://ifconfig.me) + echo "Runner Public IP: $IP" + echo "Create PostgreSQL Flexible Server" + PGDB_NAME="pg-rest-api-westeurope" az postgres flexible-server create \ --resource-group $RESOURCE_GROUP \ --name $PGDB_NAME \ @@ -46,8 +44,7 @@ jobs: --sku-name Standard_B1ms \ --storage-size 32 \ --version 16 - --yes - # --public-access 13.82.232.186 + --public-access $IP # echo "Add Firewall Rule" # az postgres flexible-server firewall-rule create \ From 673fbc73e92f62bb5a345c6646d3cc344f949b50 Mon Sep 17 00:00:00 2001 From: katerynaZh Date: Mon, 30 Jun 2025 21:46:58 +0200 Subject: [PATCH 4/6] minor fix --- .github/workflows/pgdb-create.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pgdb-create.yaml b/.github/workflows/pgdb-create.yaml index 5f8229a..7c87dfb 100644 --- a/.github/workflows/pgdb-create.yaml +++ b/.github/workflows/pgdb-create.yaml @@ -43,7 +43,7 @@ jobs: --tier Burstable \ --sku-name Standard_B1ms \ --storage-size 32 \ - --version 16 + --version 16 \ --public-access $IP # echo "Add Firewall Rule" From c1e3c4b66af2fcb8d62c08a9f9f1d1b76fbb5291 Mon Sep 17 00:00:00 2001 From: katerynaZh Date: Mon, 30 Jun 2025 21:55:02 +0200 Subject: [PATCH 5/6] remove adding firewall rule --- .github/workflows/pgdb-create.yaml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/pgdb-create.yaml b/.github/workflows/pgdb-create.yaml index 7c87dfb..c59159c 100644 --- a/.github/workflows/pgdb-create.yaml +++ b/.github/workflows/pgdb-create.yaml @@ -45,15 +45,7 @@ jobs: --storage-size 32 \ --version 16 \ --public-access $IP - - # echo "Add Firewall Rule" - # az postgres flexible-server firewall-rule create \ - # --resource-group $RESOURCE_GROUP \ - # --name $PGDB_NAME \ - # --rule-name github-temp \ - # --start-ip-address $IP \ - # --end-ip-address $IP - + echo "Check PostgreSQL server status" az postgres flexible-server show \ --name $PGDB_NAME \ From 35d046d16f8d0890845fd4da6f236901d0c173f1 Mon Sep 17 00:00:00 2001 From: katerynaZh Date: Mon, 30 Jun 2025 21:59:25 +0200 Subject: [PATCH 6/6] add manual trigger to rg-cleanup --- .github/workflows/rg-cleanup.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rg-cleanup.yaml b/.github/workflows/rg-cleanup.yaml index 0967a55..ae22539 100644 --- a/.github/workflows/rg-cleanup.yaml +++ b/.github/workflows/rg-cleanup.yaml @@ -3,6 +3,7 @@ name: "Daily Resource Group Cleanup Pipeline" on: schedule: - cron: '0 23 * * *' # Every day at 23:00 UTC + workflow_dispatch: permissions: id-token: write # ОБОВ'ЯЗКОВО для OIDC логіну