Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 41 additions & 38 deletions .github/workflows/deploytoAKS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v2

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1.5.0
uses: actions/setup-dotnet@v2
with:
# SDK version to use. Examples: 2.2.104, 3.1, 3.1.x
dotnet-version: 3.1.x
Expand All @@ -43,43 +43,46 @@ jobs:
- name: push docker image
run: docker push '${{secrets.DOCKER_LOGIN}}'/githubactions-aks-demo:'${{github.sha}}'

# - name: Azure Kubernetes set context
# uses: Azure/aks-set-context@v1
# with:
# # Azure credentials i.e. output of `az ad sp create-for-rbac --sdk-auth`
# creds: '${{secrets.AZURE_CREDENTIALS}}'
# # Resource Group Name
# resource-group: aks-demo-rg
# # AKS Cluster Name
# cluster-name: ga-aks-demo-cluster
- name: Azure Kubernetes set context
uses: Azure/aks-set-context@v1
with:
# Azure credentials i.e. output of `az ad sp create-for-rbac --sdk-auth`
creds: '${{secrets.AZURE_CREDENTIALS}}'
# Resource Group Name
resource-group: samarth-resources-msdn
# AKS Cluster Name
cluster-name: test-ingress

# # Create K8s secrets to pull images
# - name: Create secret in Kubernetes cluster
# uses: Azure/k8s-create-secret@v1.1
# with:
# # Container registry url
# container-registry-url: https://index.docker.io/v1/
# # Container registry username
# container-registry-username: '${{secrets.DOCKER_LOGIN}}'
# # Container registry password
# container-registry-password: '${{secrets.DOCKER_PASSWORD}}'
# # Type of Kubernetes secret. For example, docker-registry or generic
# secret-type: docker-registry
# # Name of the secret. You can use this secret name in the Kubernetes YAML configuration file.
# secret-name: docker-image-pull-secret
# Create K8s secrets to pull images
- name: Create secret in Kubernetes cluster
uses: Azure/k8s-create-secret@v1.1
with:
# Container registry url
container-registry-url: https://index.docker.io/v1/
# Container registry username
container-registry-username: '${{secrets.DOCKER_LOGIN}}'
# Container registry password
container-registry-password: '${{secrets.DOCKER_PASSWORD}}'
# Type of Kubernetes secret. For example, docker-registry or generic
secret-type: docker-registry
# Name of the secret. You can use this secret name in the Kubernetes YAML configuration file.
secret-name: docker-image-pull-secret

# Deploy to k8s cluster
- name: Deploy to Kubernetes cluster
uses: Azure/k8s-deploy@v1
with:
# Path to the manifest files which will be used for deployment.
manifests: |
k8s/deployment.yml
k8s/service.yml
# Fully qualified resource URL of the image(s) to be used for substitutions on the manifest files Example: contosodemo.azurecr.io/helloworld:test
images: '${{secrets.DOCKER_LOGIN}}/githubactions-aks-demo:${{github.sha}}'
# Name of a docker-registry secret that has already been set up within the cluster. Each of these secret names are added under imagePullSecrets field for the workloads found in the input manifest files
imagepullsecrets: docker-image-pull-secret
# deploy/promote/reject
action: deploy

# # Deploy to k8s cluster
# - name: Deploy to Kubernetes cluster
# uses: Azure/k8s-deploy@v1
# with:
# # Path to the manifest files which will be used for deployment.
# manifests: |
# k8s/deployment.yml
# k8s/service.yml
# # Fully qualified resource URL of the image(s) to be used for substitutions on the manifest files Example: contosodemo.azurecr.io/helloworld:test
# images: '${{secrets.DOCKER_LOGIN}}/githubactions-aks-demo:${{github.sha}}'
# # Name of a docker-registry secret that has already been set up within the cluster. Each of these secret names are added under imagePullSecrets field for the workloads found in the input manifest files
# imagepullsecrets: docker-image-pull-secret
# # deploy/promote/reject
# action: deploy