Skip to content

Deploy to Azure Container Instance #2

Deploy to Azure Container Instance

Deploy to Azure Container Instance #2

Workflow file for this run

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 }}