Skip to content

Commit

Permalink
Updated pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
KalyanaVadlamani committed Mar 25, 2024
1 parent d06d47d commit 69dae3a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 25 deletions.
59 changes: 35 additions & 24 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,41 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set environment-specific variables
id: set_vars
run: |
if [ "${{ github.event.inputs.github_environment }}" = "production" ]; then
echo "KUBE_CLUSTER=${{ secrets.PRODUCTION_KUBE_CLUSTER }}" >> $GITHUB_ENV
echo "KUBE_NAMESPACE=${{ secrets.PRODUCTION_KUBE_NAMESPACE }}" >> $GITHUB_ENV
echo "KUBE_TOKEN=${{ secrets.PRODUCTION_KUBE_TOKEN }}" >> $GITHUB_ENV
echo "KUBE_CERT=${{ secrets.PRODUCTION_KUBE_CERT }}" >> $GITHUB_ENV
echo "KUBE_API=https://${{ secrets.PRODUCTION_KUBE_CLUSTER }}" >> $GITHUB_ENV
else
echo "KUBE_CLUSTER=${{ secrets.DEVELOPMENT_KUBE_CLUSTER }}" >> $GITHUB_ENV
echo "KUBE_NAMESPACE=${{ secrets.DEVELOPMENT_KUBE_NAMESPACE }}" >> $GITHUB_ENV
echo "KUBE_TOKEN=${{ secrets.DEVELOPMENT_KUBE_TOKEN }}" >> $GITHUB_ENV
echo "KUBE_CERT=${{ secrets.DEVELOPMENT_KUBE_CERT }}" >> $GITHUB_ENV
echo "KUBE_API=https://${{ secrets.DEVELOPMENT_KUBE_CLUSTER }}" >> $GITHUB_ENV
fi
# - name: Set environment-specific variables
# id: set_vars
# run: |
# if [ "${{ github.event.inputs.github_environment }}" = "production" ]; then
# echo "KUBE_CLUSTER=${{ secrets.PRODUCTION_KUBE_CLUSTER }}" >> $GITHUB_ENV
# echo "KUBE_NAMESPACE=${{ secrets.PRODUCTION_KUBE_NAMESPACE }}" >> $GITHUB_ENV
# echo "KUBE_TOKEN=${{ secrets.PRODUCTION_KUBE_TOKEN }}" >> $GITHUB_ENV
# echo "KUBE_CERT=${{ secrets.PRODUCTION_KUBE_CERT }}" >> $GITHUB_ENV
# echo "KUBE_API=https://${{ secrets.PRODUCTION_KUBE_CLUSTER }}" >> $GITHUB_ENV
# else
# echo "KUBE_CLUSTER=${{ secrets.DEVELOPMENT_KUBE_CLUSTER }}" >> $GITHUB_ENV
# echo "KUBE_NAMESPACE=${{ secrets.DEVELOPMENT_KUBE_NAMESPACE }}" >> $GITHUB_ENV
# echo "KUBE_TOKEN=${{ secrets.DEVELOPMENT_KUBE_TOKEN }}" >> $GITHUB_ENV
# echo "KUBE_CERT=${{ secrets.DEVELOPMENT_KUBE_CERT }}" >> $GITHUB_ENV
# echo "KUBE_API=https://${{ secrets.DEVELOPMENT_KUBE_CLUSTER }}" >> $GITHUB_ENV
# fi

- name: Deploy to Cloud Platform
- name: Deploy to Dev
uses: ./.github/actions/cloud-platform-deploy
with:
environment: ${{ github.event.inputs.github_environment }}
version: ${{ github.event.inputs.github_environment }}
api: https://${{ secrets.KUBE_CLUSTER }}
cert: ${{ secrets.KUBE_CERT }}
cluster: ${{ secrets.KUBE_CLUSTER }}
namespace: ${{ secrets.KUBE_NAMESPACE }}
token: ${{ secrets.KUBE_TOKEN }}
environment: ${{ inputs.environment }}
version: ${{ inputs.version }}
api: https://${{ secrets.DEVELOPMENT_KUBE_CLUSTER }}
cert: ${{ secrets.DEVELOPMENT_KUBE_CERT }}
cluster: ${{ secrets.DEVELOPMENT_KUBE_CLUSTER }}
namespace: ${{ secrets.DEVELOPMENT_KUBE_NAMESPACE }}
token: ${{ secrets.DEVELOPMENT_KUBE_TOKEN }}

- name: Deploy to Prod
uses: ./.github/actions/cloud-platform-deploy
with:
environment: ${{ inputs.environment }}
version: ${{ inputs.version }}
api: https://${{ secrets.PRODUCTION_KUBE_CLUSTER }}
cert: ${{ secrets.PRODUCTION_KUBE_CERT }}
cluster: ${{ secrets.PRODUCTION_KUBE_CLUSTER }}
namespace: ${{ secrets.PRODUCTION_KUBE_NAMESPACE }}
token: ${{ secrets.PRODUCTION_KUBE_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
name: Deploy to prod
uses: ./.github/workflows/deploy.yml
needs:
- build
- deploy_to_dev # wait for the deploy_to_dev job to complete
with:
github_environment: production
Expand Down

0 comments on commit 69dae3a

Please sign in to comment.