diff --git a/.github/workflows/call_release_function.yml b/.github/workflows/call_release_function.yml index dddfed32f..8d004424c 100644 --- a/.github/workflows/call_release_function.yml +++ b/.github/workflows/call_release_function.yml @@ -22,20 +22,20 @@ jobs: steps: - - name: Setup Maven Action - uses: s4u/setup-maven-action@fa2c7e4517ed008b1f73e7e0195a9eecf5582cd4 # v1.11.0 - with: - checkout-fetch-depth: 0 - java-version: 17 - java-distribution: 'temurin' - maven-version: '3.9.5' - cache-enabled: true + # - name: Setup Maven Action + # uses: s4u/setup-maven-action@fa2c7e4517ed008b1f73e7e0195a9eecf5582cd4 # v1.11.0 + # with: + # checkout-fetch-depth: 0 + # java-version: 17 + # java-distribution: 'temurin' + # maven-version: '3.9.5' + # cache-enabled: true - - name: Build Functions App - shell: bash - run: | - mvn --projects :onboarding-functions --also-make package install -DskipTests \ - -Dquarkus.azure-functions.app-name=${{ vars.AZURE_ONBOARDING_FN_APP_NAME }} + # - name: Build Functions App + # shell: bash + # run: | + # mvn --projects :onboarding-functions --also-make package install -DskipTests \ + # -Dquarkus.azure-functions.app-name=${{ vars.AZURE_ONBOARDING_FN_APP_NAME }} - name: Log in to Azure uses: azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 @@ -44,14 +44,14 @@ jobs: tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Deploy Function App - shell: bash - working-directory: apps/onboarding-functions - run: | - mvn -f pom.xml quarkus:deploy \ - -Dquarkus.azure-functions.app-name=${{ vars.AZURE_ONBOARDING_FN_APP_NAME }} \ - -Dquarkus.azure-functions.subscription-id=${{ secrets.AZURE_SUBSCRIPTION_ID }} \ - -Dquarkus.azure-functions.resource-group=${{ vars.AZURE_ONBOARDING_FN_RESOURCE_GROUP }} \ - -Dquarkus.azure-functions.region=westeurope \ - -Dquarkus.azure-functions.app-service-plan-name=${{ vars.AZURE_ONBOARDING_FN_SERVICE_PLAN }} \ - -Dquarkus.azure-functions.runtime.java-version=17 + # - name: Deploy Function App + # shell: bash + # working-directory: apps/onboarding-functions + # run: | + # mvn -f pom.xml quarkus:deploy \ + # -Dquarkus.azure-functions.app-name=${{ vars.AZURE_ONBOARDING_FN_APP_NAME }} \ + # -Dquarkus.azure-functions.subscription-id=${{ secrets.AZURE_SUBSCRIPTION_ID }} \ + # -Dquarkus.azure-functions.resource-group=${{ vars.AZURE_ONBOARDING_FN_RESOURCE_GROUP }} \ + # -Dquarkus.azure-functions.region=westeurope \ + # -Dquarkus.azure-functions.app-service-plan-name=${{ vars.AZURE_ONBOARDING_FN_SERVICE_PLAN }} \ + # -Dquarkus.azure-functions.runtime.java-version=17 diff --git a/.github/workflows/release_functions.yml b/.github/workflows/release_functions.yml index bb0201652..89d77eb3a 100644 --- a/.github/workflows/release_functions.yml +++ b/.github/workflows/release_functions.yml @@ -5,11 +5,11 @@ on: branches: - main - releases/** - - EC-96-pipeline-deployment-con-supporto-ambienti # TODO: remove - paths: - - 'apps/onboarding-functions/**' - - "apps/pom.xml" - - "pom.xml" + - EC-97-pipeline-function-app-deployment-aggiunta-supporto-ambienti-e-branch # TODO: remove + # paths: + # - 'apps/onboarding-functions/**' + # - "apps/pom.xml" + # - "pom.xml" # New branch created from main, deploy it in UAT workflow_run: @@ -18,36 +18,10 @@ on: types: - completed - # TODO: remove - pull_request: - branches: - - main - types: - - opened - - edited - - synchronize - - reopened - - ready_for_review - paths: - - 'apps/onboarding-functions/**' - - "apps/pom.xml" - # deploy UAT when create a new branch release*, condition below contains() permit to execute worflow only for 'release' branch # create: - workflow_dispatch: # choose the branch - # inputs: - # environment: - # required: true - # type: choice - # description: Select the Environment - # options: - # - dev - # - uat - # - prod - -# env: -# ENV_NAME: "${{ inputs.environment != null && inputs.environment || (github.base_ref == 'main' && 'dev' || (contains(github.ref_name, 'release') && 'uat' || 'dev')) }}" + workflow_dispatch: jobs: @@ -67,7 +41,7 @@ jobs: release_dev: uses: ./.github/workflows/call_release_function.yml - name: Dev Release OnBoarding function + name: '[Dev] OnBoarding function Release' # needs: [environment] TODO: change # if: github.ref_name == 'main' if: startsWith(github.ref_name, 'ec-97') @@ -77,18 +51,19 @@ jobs: release_uat: uses: ./.github/workflows/call_release_function.yml - name: UAT OnBoarding function Release + name: '[UAT] OnBoarding function Release' needs: [release_dev] # TODO: change if: startsWith(github.ref_name, 'ec-97') secrets: inherit with: environment: uat - # release_prod: - # uses: ./.github/workflows/call_release_function.yml - # name: Prod OnBoarding function Release - # needs: [release_uat] - # if: startsWith(github.ref_name, 'releases/') - # secrets: inherit - # with: - # environment: prod + release_prod: + uses: ./.github/workflows/call_release_function.yml + name: '[Prod] OnBoarding function Release' + needs: [release_uat] + if: (needs.release_uat.result == 'skipped' || needs.release_uat.result == 'success') && startsWith(github.ref_name, 'ec-97') + # if: startsWith(github.ref_name, 'releases/') + secrets: inherit + with: + environment: prod