fix: trivy yaml syntax #4
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: CD Pipeline | |
| on: | |
| push: | |
| branches: [main] | |
| env: | |
| AWS_REGION: us-east-1 | |
| EKS_CLUSTER_NAME: ${{ secrets.EKS_CLUSTER_NAME }} | |
| jobs: | |
| deploy: | |
| name: Deploy to EKS | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: Update kubeconfig | |
| run: | | |
| aws eks update-kubeconfig --name $EKS_CLUSTER_NAME --region $AWS_REGION | |
| - name: Deploy user-service | |
| run: | | |
| kubectl set image deployment/user-service \ | |
| user-service=${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/ecommerce/user-service:${{ github.sha }} | |
| - name: Deploy product-service | |
| run: | | |
| kubectl set image deployment/product-service \ | |
| product-service=${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/ecommerce/product-service:${{ github.sha }} | |
| - name: Verify rollout | |
| run: | | |
| kubectl rollout status deployment/user-service | |
| kubectl rollout status deployment/product-service |