-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2de5fc9
commit 5a4343c
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 }} |