Skip to content

Commit 83a3847

Browse files
chore: update gh actions PIDM-487
1 parent 90b52a1 commit 83a3847

File tree

2 files changed

+11
-46
lines changed

2 files changed

+11
-46
lines changed

.github/workflows/deploy_with_github_runner.yml

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
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

1115
env:
1216
APP_NAME: apiconfig-selfcare-integration
@@ -17,37 +21,15 @@ permissions:
1721
contents: read
1822

1923
jobs:
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 }}
@@ -56,27 +38,8 @@ jobs:
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 ]

.github/workflows/release_deploy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Release And Deploy
33
# Controls when the workflow will run
44
on:
55
pull_request:
6+
branches:
7+
- main
68
types: [ closed ]
79

810
# Allows you to run this workflow manually from the Actions tab
@@ -21,7 +23,7 @@ on:
2123
type: choice
2224
description: Select the version
2325
options:
24-
- ''
26+
- patch
2527
- skip_or_promote
2628
- new_release
2729
- breaking_change

0 commit comments

Comments
 (0)