Skip to content

Commit

Permalink
updated the called workflow with secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
shashi2504 authored Jan 8, 2025
1 parent 1f2789b commit ad8ffc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/reuse-deployments.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Reusable Workflows

on:
workflow_call:
workflow_call:
secrets:
k8s-kubeconfig:
required: true
mongodb-password:
required: true

jobs:
reuse-deploy:
Expand All @@ -25,7 +30,7 @@ jobs:
uses: azure/k8s-set-context@v4
with:
method: kubeconfig
kubeconfig: ${{ secrets.KUBECONFIG }}
kubeconfig: ${{ secrets.k8s-kubeconfig }}

- name: Fetch K8s Cluster Details
run: |
Expand Down Expand Up @@ -58,7 +63,7 @@ jobs:
kubectl -n ${{ vars.NAMESPACE }} create secret generic mongo-db-creds \
--from-literal=MONGO_URI=${{ env.MONGO_URI }} \
--from-literal=MONGO_USERNAME=${{ vars.MONGO_USERNAME }} \
--from-literal=MONGO_PASSWORD=${{ secrets.MONGO_PASSWORD }} \
--from-literal=MONGO_PASSWORD=${{ secrets.mongodb-password }} \
--save-config \
--dry-run=client \
-o yaml | kubectl apply -f -
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/solar-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ jobs:
name: Deploying Application to the Development Env Production
needs: docker
uses: ./.github/workflows/reuse-deployments.yml
secrets:
k8s-kubeconfig: ${{ secrets.KUBECONFIG }}
mongodb-password: ${{ secrets.MONGO_PASSWORD }}

dev-integration-testing:
if: contains(github.ref, 'feature/')
Expand Down

0 comments on commit ad8ffc9

Please sign in to comment.