Skip to content

hotfix: fix async methods #2

hotfix: fix async methods

hotfix: fix async methods #2

Workflow file for this run

name: CD - Deploy to Azure (Production)
on:
push:
branches:
- main
workflow_dispatch:
env:
AZURE_WEBAPP_NAME: restaurant-prod-api
AZURE_CONTAINER_REGISTRY: restaurantapiregistry.azurecr.io
IMAGE_NAME: restaurant-api
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Azure Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.AZURE_CONTAINER_REGISTRY }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./src/Restaurant.API/Dockerfile
push: true
tags: ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: Production
steps:
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS_PROD }}
- name: Deploy container image
run: |
az webapp config container set \
--name ${{ env.AZURE_WEBAPP_NAME }} \
--resource-group ${{ secrets.AZURE_RESOURCE_GROUP_PROD }} \
--docker-custom-image-name ${{ env.AZURE_CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
--docker-registry-server-url https://${{ env.AZURE_CONTAINER_REGISTRY }}
az webapp restart \
--name ${{ env.AZURE_WEBAPP_NAME }} \
--resource-group ${{ secrets.AZURE_RESOURCE_GROUP_PROD }}