Created
October 8, 2022 13:33
-
-
Save Nikila99gimhan/9867748d63322e009bb23aeaaabb10df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Logs in to the Azure Container Registry | |
- uses: Azure/docker-login@v1 | |
with: | |
login-server: ${{ env.AZURE_CONTAINER_REGISTRY }} | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
# Build and push image to Azure Container Registry | |
- name: Build and push image to Azure Container Registry | |
run: | | |
docker build . -t ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ env.CONTAINER_NAME }}:${{ github.sha }} | |
docker push ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ env.CONTAINER_NAME }}:${{ github.sha }} | |
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file | |
- name: Get K8s context | |
uses: Azure/aks-set-context@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
cluster-name: ${{ env.CLUSTER_NAME }} | |
resource-group: ${{ env.RESOURCE_GROUP }} | |
# Create Image Pull Secret | |
- name: Create Image Pull Secret | |
uses: Azure/k8s-create-secret@v1 | |
with: | |
container-registry-url: ${{ env.AZURE_CONTAINER_REGISTRY }} | |
container-registry-username: ${{ secrets.ACR_USERNAME }} | |
container-registry-password: ${{ secrets.ACR_PASSWORD }} | |
secret-name: ${{ env.IMAGE_PULL_SECRET_NAME }} | |
# Deploy to AKS | |
- name: Deploy to AKS | |
uses: Azure/k8s-deploy@v1 | |
with: | |
manifests: | | |
manifests/deployment.yml | |
manifests/service.yml | |
images: | | |
${{ env.AZURE_CONTAINER_REGISTRY }}/${{ env.CONTAINER_NAME }}:${{ github.sha }} | |
imagepullsecrets: | | |
${{ env.IMAGE_PULL_SECRET_NAME }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment