Skip to content

Commit

Permalink
custom action added
Browse files Browse the repository at this point in the history
  • Loading branch information
Aadesh619 committed Jan 6, 2024
1 parent 07f4e95 commit 3201462
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 12 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
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 "[email protected]"
# 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

# 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 }}
21 changes: 21 additions & 0 deletions deployment.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3201462

Please sign in to comment.