Skip to content

Commit

Permalink
Merge pull request LSFLK#7 from LDFLK/aks-devhub-rnkau
Browse files Browse the repository at this point in the history
Add workflow to deploy to AKS
  • Loading branch information
kosalag authored Nov 25, 2022
2 parents 158b367 + a5cee38 commit 3344953
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/gigapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: gigapi
"on":
push:
branches:
- master
workflow_dispatch: {}
env:
ACR_RESOURCE_GROUP: acrworkflow1669353226260
AZURE_CONTAINER_REGISTRY: gigapi
CLUSTER_NAME: gig-aks
CLUSTER_RESOURCE_GROUP: GIG
CONTAINER_NAME: gig-api
DEPLOYMENT_MANIFEST_PATH: |
./deployment/gig/gig-api-deployment.yaml
./deployment/gig/gig-api-ingress.yaml
./deployment/gig/gig-api-service.yaml
jobs:
buildImage:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: azure/[email protected]
name: Azure login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
- name: Build and push image to ACR
run: az acr build --image ${{ env.CONTAINER_NAME }}:${{ github.sha }} --registry ${{ env.AZURE_CONTAINER_REGISTRY }} -g ${{ env.ACR_RESOURCE_GROUP }} -f ./Dockerfile ./
deploy:
permissions:
actions: read
contents: read
id-token: write
runs-on: ubuntu-latest
needs:
- buildImage
steps:
- uses: actions/checkout@v3
- uses: azure/[email protected]
name: Azure login
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
- uses: azure/aks-set-context@v3
name: Get K8s context
with:
cluster-name: ${{ env.CLUSTER_NAME }}
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
- uses: Azure/k8s-deploy@v4
name: Deploys application
with:
action: deploy
images: ${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }}
manifests: ${{ env.DEPLOYMENT_MANIFEST_PATH }}
namespace: applications

0 comments on commit 3344953

Please sign in to comment.