Skip to content

Update Workflow and Codespace Env, ReadMe #12

Update Workflow and Codespace Env, ReadMe

Update Workflow and Codespace Env, ReadMe #12

name: Build, Push and Deploy to AKS
on:
push:
branches:
- main
workflow_dispatch:
permissions:
id-token: write
contents: read
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Azure Container Registry
uses: docker/login-action@v1
with:
registry: loveofsports.azurecr.io
username: ${{ env.AZURE_CLIENT_ID }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker images
run: |
docker-compose -f docker-compose.yml build
docker-compose -f docker-compose.yml push
deploy:
needs: build-and-push
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Kubectl
uses: azure/setup-kubectl@v1
- name: Login to Azure AKS
run: az aks get-credentials --resource-group myResourceGroup --name myAKSCluster
- name: Deploy to AKS
run: kubectl apply -f path_to_kubernetes_manifests/
# If using Git LFS, ensure LFS objects are pulled
- name: Pull Git LFS objects
run: git lfs pull