This commit is contained in:
faris Aljohari
2024-07-30 16:23:24 +03:00

View File

@ -11,7 +11,7 @@ env:
AZURE_WEB_APP_SLOT_NAME: 'dev'
ACR_REGISTRY: 'syncrow.azurecr.io'
IMAGE_NAME: 'backend'
IMAGE_TAG: '${{ github.sha }}' # Use commit SHA for unique tagging
IMAGE_TAG: 'latest'
jobs:
build_and_deploy:
@ -25,13 +25,10 @@ jobs:
with:
node-version: '20'
- name: Clear npm cache and install dependencies
- name: Install dependencies and build project
run: |
npm cache clean --force
npm install
- name: Build project
run: npm run build
npm run build
- name: Log in to Azure
uses: azure/login@v1
@ -56,6 +53,3 @@ jobs:
--resource-group backend \
--docker-custom-image-name ${{ env.ACR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} \
--docker-registry-server-url https://${{ env.ACR_REGISTRY }}
- name: Restart Web App
run: az webapp restart --name ${{ env.AZURE_WEB_APP_NAME }} --resource-group backend