Skip to content

Commit

Permalink
Deploy to Azure Container Instance
Browse files Browse the repository at this point in the history
  • Loading branch information
MohanKrishnaGR authored Jun 26, 2024
1 parent 2de5fc9 commit 5a4343c
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/azure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy to Azure Container Instance

on:
push:
branches:
- main

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_RBAC_CREDENTIALS }} # set up AZURE_RBAC_CREDENTIALS secrets in your repository

- name: Update Azure Container Instance
run: |
az container update \
--resource-group ${{ secrets.RESOURCE_GROUP }} \
--name ${{ secrets.CONTAINER_GROUP_NAME }} \
--containers name=${{ secrets.CONTAINER_NAME }} image=${{ secrets.REGISTRY_NAME }}/infosys_text-summarization:latest
- name: Restart Azure Container Instance
run: |
az container restart \
--resource-group ${{ secrets.RESOURCE_GROUP }} \
--name ${{ secrets.CONTAINER_GROUP_NAME }}

0 comments on commit 5a4343c

Please sign in to comment.