Skip to content

Commit

Permalink
Added prod Job
Browse files Browse the repository at this point in the history
  • Loading branch information
asharmah4h committed Feb 13, 2024
1 parent d96cfb5 commit 64522fb
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 7 deletions.
61 changes: 59 additions & 2 deletions .github/workflows/DeployToAKS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ env:
#CHART_OVERRIDE_PATH: "your-chart-override-path"

jobs:
deploy:
deployToDev:
name: Deploy to Developemnt
permissions:
actions: read
contents: read
id-token: write
runs-on: ubuntu-latest
environment: Development
steps:
# Checks out the repository this file is in
- uses: actions/checkout@v3
Expand Down Expand Up @@ -99,4 +101,59 @@ jobs:
manifests: ${{ steps.bake.outputs.manifestsBundle }}
namespace: "ic-core-dev"
images: |
${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }}
${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }}
deployToProd:
name: Deploy to Production
permissions:
actions: read
contents: read
id-token: write
runs-on: ubuntu-latest
environment: Production
steps:
# Checks out the repository this file is in
- uses: actions/checkout@v3

# Logs in with your Azure credentials
- name: Azure login
uses: azure/login@v1.4.6
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

# Use kubelogin to configure your kubeconfig for Azure auth
- name: Set up kubelogin for non-interactive login
uses: azure/use-kubelogin@v1
with:
kubelogin-version: 'v0.0.25'

# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
- name: Get K8s context
uses: azure/aks-set-context@v3
with:
resource-group: ${{ env.RESOURCE_GROUP }}
cluster-name: ${{ env.CLUSTER_NAME }}
admin: 'false'
use-kubelogin: 'true'

# Runs Helm to create manifest files
- name: Bake deployment
uses: azure/k8s-bake@v2
with:
renderEngine: "helm"
helmChart: ${{ env.CHART_PATH }}
#overrideFiles: ${{ env.CHART_OVERRIDE_PATH }}
overrides: |
replicas:2
helm-version: "latest"
id: bake

# Deploys application based on manifest files from previous step
- name: Deploy application
uses: Azure/k8s-deploy@v4
with:
action: deploy
manifests: ${{ steps.bake.outputs.manifestsBundle }}
namespace: "ic-core-acc"
images: |
${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }}
6 changes: 1 addition & 5 deletions helm-charts/infini-connect-ui/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ If release name contains chart name it will be used as a full name.
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

Expand Down

0 comments on commit 64522fb

Please sign in to comment.