.github/workflows/deploy.yml #23
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
name: Deploy to AKS | |
on: | |
# push: | |
# branches: | |
# - main | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Azure Login | |
run: | | |
az login --service-principal -u ${{ secrets.ARM_CLIENT_ID }} -p ${{ secrets.ARM_CLIENT_SECRET }} --tenant ${{ secrets.ARM_TENANT_ID }} | |
- name: Start AKS Cluster | |
run: | | |
az aks start --name myAKSCluster --resource-group Demo-rg | |
az aks get-credentials --resource-group Demo-rg --name myAKSCluster | |
- name: Deploy to AKS | |
run: | | |
kubectl apply -f manifestfile.yml | |
working-directory: ./myapp | |
- name: Port Forwarding | |
run: | | |
kubectl port-forward svc/my-app 5070:5070 & | |
- name: Test Application | |
run: | | |
curl http://localhost:5070/products | |