Skip to content

Commit a93315d

Browse files
authored
feat: Added optional working directory to aks-deploy (#70)
* added optional working directory to aks-deploy * update actions/cache to 4.2.0
1 parent ae5e4d2 commit a93315d

File tree

4 files changed

+52
-3
lines changed

4 files changed

+52
-3
lines changed

aks-deploy/action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ inputs:
4747
description: options you can pass to helm upgrade command
4848
type: string
4949
default: ''
50+
working_directory:
51+
required: false
52+
description: working directory where run command is executed
53+
type: string
54+
default: ''
5055
timeout:
5156
required: false
5257
description: to set the timeout for the helm upgrade command
@@ -55,6 +60,7 @@ inputs:
5560

5661
runs:
5762
using: "composite"
63+
5864
steps:
5965
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
6066
with:
@@ -75,15 +81,28 @@ runs:
7581
admin: 'false'
7682
use-kubelogin: 'true'
7783

84+
- name: Determine Working Directory
85+
id: determine-dir
86+
shell: bash
87+
run: |
88+
if [ -n "${{ inputs.working_directory }}" ]; then
89+
echo "working_dir=${{ inputs.working_directory }}" >> $GITHUB_ENV
90+
else
91+
echo "working_dir=." >> $GITHUB_ENV
92+
fi
93+
echo "Working directory determined: $working_dir"
94+
7895
- name: 🛠️ Helm configure repos
7996
shell: bash
97+
working-directory: ${{ env.working_dir }}
8098
run: |
8199
helm repo add microservice-chart https://pagopa.github.io/aks-microservice-chart-blueprint
82100
helm dep build helm
83101
echo "✅ aks blueprint configured"
84102
85103
- name: 🚀 Helm Deploy
86104
shell: bash
105+
working-directory: ${{ env.working_dir }}
87106
run: |
88107
echo "🚀 Launch helm deploy"
89108

helm-bump/action.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ inputs:
1010
required: true
1111
type: boolean
1212
description: True if it is a beta version (update canary helm version)
13+
working_directory:
14+
required: false
15+
description: working directory where run command is executed
16+
type: string
17+
default: ''
1318

1419
runs:
1520
using: "composite"
@@ -21,8 +26,20 @@ runs:
2126
echo "beta: ${{ inputs.beta}}"
2227
shell: bash
2328

29+
- name: Determine Working Directory
30+
id: determine-dir
31+
shell: bash
32+
run: |
33+
if [ -n "${{ inputs.working_directory }}" ]; then
34+
echo "working_dir=${{ inputs.working_directory }}" >> $GITHUB_ENV
35+
else
36+
echo "working_dir=." >> $GITHUB_ENV
37+
fi
38+
echo "Working directory determined: $working_dir"
39+
2440
- id: get_chart_version
2541
name: Get Version
42+
working-directory: ${{ env.working_dir }}
2643
run: |
2744
CHART_FILE="helm/Chart.yaml"
2845
if [[ -f "$CHART_FILE" ]]; then
@@ -39,6 +56,7 @@ runs:
3956

4057
- name: Update Chart Version
4158
shell: bash
59+
working-directory: ${{ env.working_dir }}
4260
run: |
4361
echo "📑 Bump Chart Version to ${{ steps.bump_chart_version.outputs.new_version }}"
4462
@@ -50,6 +68,7 @@ runs:
5068
5169
- name: Update Stable Version Helm
5270
shell: bash
71+
working-directory: ${{ env.working_dir }}
5372
if: ${{ inputs.beta != 'true' }}
5473
run: |
5574
echo "🚀 Bump Stable Version to ${{ inputs.version }}"
@@ -68,6 +87,7 @@ runs:
6887
6988
- name: Update Canary Version Helm
7089
shell: bash
90+
working-directory: ${{ env.working_dir }}
7191
if: ${{ inputs.beta == 'true' }}
7292
run: |
7393
echo "🐤 Bump Canary Version to ${{ inputs.version }}"

sbt-release/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ inputs:
3434
options:
3535
- 11
3636
- 17
37+
working_directory:
38+
required: false
39+
description: Working directory where run command is executed
40+
type: string
41+
default: ''
3742

3843

3944
outputs:
@@ -64,7 +69,7 @@ runs:
6469
semver: ${{inputs.semver}}
6570
beta: ${{inputs.beta}}
6671
jdk_version: ${{inputs.jdk_version}}
67-
72+
working_directory: ${{inputs.working_directory}}
6873

6974
- name: Push New Version
7075
if: ${{ inputs.semver != 'skip' }}

sbt-semver/action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ inputs:
2424
options:
2525
- 11
2626
- 17
27+
working_directory:
28+
required: false
29+
description: Working directory where run command is executed
30+
type: string
31+
default: ''
2732

2833

2934
outputs:
@@ -54,7 +59,7 @@ runs:
5459
with:
5560
maven-version: 3.8.2
5661
- name: Cache Maven packages
57-
uses: actions/cache@f5ce41475b483ad7581884324a6eca9f48f8dcc7 # v1
62+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
5863
with:
5964
path: ~/.m2
6065
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
@@ -130,7 +135,7 @@ runs:
130135
with:
131136
version: ${{ steps.get_app_version.outputs.version }}
132137
beta: ${{ inputs.beta }}
133-
138+
working_directory: ${{ inputs.working_directory }}
134139

135140
- name: Update Openapi/Swagger Version
136141
if: ${{ inputs.semver != 'skip' }}

0 commit comments

Comments
 (0)