77 required : true
88 description : The name of the environment where to deploy
99 type : string
10+ branch :
11+ required : false
12+ default : ${{ github.ref_name }}
13+ type : string
1014
1115env :
1216 APP_NAME : apiconfig-selfcare-integration
@@ -17,37 +21,15 @@ permissions:
1721 contents : read
1822
1923jobs :
20- create_runner :
21- name : Create Runner
22- runs-on : ubuntu-22.04
23- environment :
24- name : ${{ inputs.environment }}
25- outputs :
26- runner_name : ${{ steps.create_github_runner.outputs.runner_name }}
27- steps :
28- - name : Create GitHub Runner
29- id : create_github_runner
30- # from https://github.com/pagopa/eng-github-actions-iac-template/tree/main/azure/github-self-hosted-runner-azure-create-action
31- uses : pagopa/eng-github-actions-iac-template/azure/github-self-hosted-runner-azure-create-action@main
32- with :
33- client_id : ${{ secrets.CLIENT_ID }}
34- tenant_id : ${{ secrets.TENANT_ID }}
35- subscription_id : ${{ secrets.SUBSCRIPTION_ID }}
36- container_app_environment_name : ${{ vars.CONTAINER_APP_ENVIRONMENT_NAME }}
37- resource_group_name : ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }} # RG of the runner
38- pat_token : ${{ secrets.BOT_TOKEN_GITHUB }}
39- self_hosted_runner_image_tag : " latest"
40-
4124 deploy :
42- needs : [ create_runner ]
43- runs-on : [ self-hosted, "${{ needs.create_runner.outputs.runner_name }}" ]
25+ runs-on : [ self-hosted-job, "${{ inputs.environment }}" ]
4426 name : Deploy on AKS
4527 environment : ${{ inputs.environment }}
4628 steps :
4729 - name : Deploy
4830 uses : pagopa/github-actions-template/aks-deploy@main
4931 with :
50- branch : ${{ github.ref_name }}
32+ branch : ${{ inputs.branch }}
5133 client_id : ${{ secrets.CLIENT_ID }}
5234 subscription_id : ${{ secrets.SUBSCRIPTION_ID }}
5335 tenant_id : ${{ secrets.TENANT_ID }}
5638 cluster_name : ${{ vars.CLUSTER_NAME }}
5739 resource_group : ${{ vars.CLUSTER_RESOURCE_GROUP }}
5840 app_name : ${{ env.APP_NAME }}
59- helm_upgrade_options : " --debug"
60- timeout : " 10m0s"
61-
62- cleanup_runner :
63- name : Cleanup Runner
64- needs : [ create_runner, deploy ]
65- if : ${{ success() || failure() }}
66- runs-on : ubuntu-22.04
67- environment : ${{ inputs.environment }}
68- steps :
69- - name : Cleanup GitHub Runner
70- id : cleanup_github_runner
71- # from https://github.com/pagopa/eng-github-actions-iac-template/tree/main/azure/github-self-hosted-runner-azure-cleanup-action
72- uses : pagopa/eng-github-actions-iac-template/azure/github-self-hosted-runner-azure-cleanup-action@0ee2f58fd46d10ac7f00bce4304b98db3dbdbe9a
73- with :
74- client_id : ${{ secrets.CLIENT_ID }}
75- tenant_id : ${{ secrets.TENANT_ID }}
76- subscription_id : ${{ secrets.SUBSCRIPTION_ID }}
77- resource_group_name : ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }}
78- runner_name : ${{ needs.create_runner.outputs.runner_name }}
79- pat_token : ${{ secrets.BOT_TOKEN_GITHUB }}
41+ helm_upgrade_options : " --debug --set microservice-chart.azure.workloadIdentityClientId=${{vars.WORKLOAD_IDENTITY_ID}}"
42+ timeout : " 15m0s"
8043
8144 update_openapi :
8245 needs : [ deploy ]
0 commit comments