Enhance README with project badges #64
This file contains hidden or 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: Payments Service CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Azure Login | |
| uses: azure/login@v2 | |
| with: | |
| creds: ${{ secrets.AZURE_CREDENTIALS }} | |
| - name: Login to Azure Container Registry | |
| run: az acr login --name devopsacr30179 | |
| - name: Build Docker image | |
| run: | | |
| docker build \ | |
| -t devopsacr30179.azurecr.io/payments-service:${{ github.sha }} \ | |
| ./phase1/payments-service | |
| - name: Push Docker image | |
| run: | | |
| docker push devopsacr30179.azurecr.io/payments-service:${{ github.sha }} | |
| # CD WOrkflow | |
| - name: Set AKS context | |
| uses: azure/aks-set-context@v3 | |
| with: | |
| resource-group: devops-rg | |
| cluster-name: devops-aks | |
| - name: Deploy payments-service to AKS | |
| run: | | |
| kubectl set image deployment/payments-deployment \ | |
| payments=${{ secrets.ACR_LOGIN_SERVER }}/payments-service:${{ github.sha }} \ | |
| -n devops | |
| kubectl rollout status deployment/payments-deployment -n devops |