From 320146230bd66fbb05dcfa8ebca90ab0910a466e Mon Sep 17 00:00:00 2001 From: aadeshkale Date: Sat, 6 Jan 2024 23:08:47 +0530 Subject: [PATCH] custom action added --- .github/workflows/ci-build.yaml | 31 +++++++++++++++++++------------ deployment.yaml | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 deployment.yaml diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 4f5e108..7b81640 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -59,17 +59,24 @@ jobs: # vuln-type: 'os,library' # severity: 'CRITICAL,HIGH' - - name: Update image tags - run: | - git config --unset-all http.https://github.com/.extraheader - git config --global user.email "aadeshkale.developer.56619@gmail.com" - git config --global user.name "dev-user" + # - name: Update image tags + # run: | + # git config --unset-all http.https://github.com/.extraheader + # git config --global user.email "aadeshkale.developer.56619@gmail.com" + # git config --global user.name "dev-user" - git clone https://Aadeshkale:${{ env.cd_token }}@github.com/Aadeshkale/kube-cd - cd kube-cd - sed -i 's|image:.*|image: 'welcome-app:${{ env.IMG_TAG }}'|' deployment.yaml - git add deployment.yaml - git commit -m "Tag updated by gitaction workflow" - git push + # git clone https://Aadeshkale:${{ env.cd_token }}@github.com/Aadeshkale/kube-cd + # cd kube-cd + # sed -i 's|image:.*|image: 'welcome-app:${{ env.IMG_TAG }}'|' deployment.yaml + # git add deployment.yaml + # git commit -m "Tag updated by gitaction workflow" + # git push - \ No newline at end of file + # using custom action + - name: edzyaml action + uses: Aadeshkale/edzyaml@main + with: + file_path: ${{ github.workspace }} + file_name: deployment.yaml + yaml_key: image + yaml_value: welcome-app:${{ env.IMG_TAG }} \ No newline at end of file diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 0000000..350590d --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: welcome-app + name: welcome-app-deployment +spec: + replicas: 3 + selector: + matchLabels: + app: welcome-app + template: + metadata: + labels: + app: welcome-app + spec: + containers: + - image: welcome-app:656 + name: welcome-app + ports: + - containerPort: 8080