Skip to content

Commit 48ba34a

Browse files
committed
ci(pipeline): enhance container image and helm chart setup
- Adds environment variables to streamline container image and helm chart configurations. - Updates the helm-related commands to use the new environment variables for better maintainability. - Ensures consistency in directory references for helm chart operations.
1 parent d6a0e57 commit 48ba34a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/pipeline.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ concurrency:
2626

2727
env:
2828
containerImage: "kubernetes-reflector"
29+
containerImageBuildContext: "src/"
30+
containerImageBuildDockerfile: "src/ES.Kubernetes.Reflector/Dockerfile"
2931
dockerHubContainerImageRepository: "emberstack"
3032
ghcrContainerImageRepository: "ghcr.io/emberstack"
33+
helmChart: "reflector"
34+
helmChartDir: "src/helm/reflector"
3135

3236

3337
jobs:
@@ -126,13 +130,13 @@ jobs:
126130
mkdir -p .artifacts/kubectl
127131
128132
- name: helm - import README
129-
run: cp README.md src/helm/reflector/README.md
133+
run: cp README.md ${{ env.helmChartDir }}/README.md
130134

131135
- name: helm - package chart
132-
run: helm package --destination .artifacts/helm --version ${{ env.gitVersion_SemVer }} --app-version ${{ env.gitVersion_SemVer }} src/helm/reflector
136+
run: helm package --destination .artifacts/helm --version ${{ env.gitVersion_SemVer }} --app-version ${{ env.gitVersion_SemVer }} ${{ env.helmChartDir }}
133137

134138
- name: helm - template chart
135-
run: helm template --namespace kube-system reflector .artifacts/helm/reflector${{ env.gitVersion_SemVer }}.tgz > .artifacts/kubectl/reflector-${{ env.gitVersion_SemVer }}.yaml
139+
run: helm template --namespace kube-system ${{ env.helmChart }} .artifacts/helm/${{ env.helmChart }}-${{ env.gitVersion_SemVer }}.tgz > .artifacts/kubectl/${{ env.helmChart }}-${{ env.gitVersion_SemVer }}.yaml
136140

137141
- name: "artifacts - upload - helm chart"
138142
uses: actions/upload-artifact@v4
@@ -180,8 +184,8 @@ jobs:
180184
- name: docker - build and push
181185
uses: docker/build-push-action@v5
182186
with:
183-
context: src/
184-
file: src/ES.Kubernetes.Reflector/Dockerfile
187+
context: ${{ env.containerImageBuildContext }}
188+
file: s${{ env.containerImageBuildDockerfile }}
185189
push: ${{ needs.discovery.outputs.requiresBuildPush == 'true' }}
186190
provenance: false
187191
platforms: linux/amd64,linux/arm/v7,linux/arm64

0 commit comments

Comments
 (0)