From 24fbb9c2c6863a4467500cd247d1a4fb05e04a3e Mon Sep 17 00:00:00 2001 From: "E. Lynette Rayle" Date: Thu, 18 Jan 2024 12:16:45 -0500 Subject: [PATCH] add deploy to Azure WebApp step --- .github/workflows/build_and_deploy_dev.yml | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_and_deploy_dev.yml b/.github/workflows/build_and_deploy_dev.yml index 716feddd5..a9e613b9e 100644 --- a/.github/workflows/build_and_deploy_dev.yml +++ b/.github/workflows/build_and_deploy_dev.yml @@ -1,14 +1,14 @@ name: Build and Deploy to dev service app on: + workflow_dispatch: push: - branches: - - elr/gh-action-dev-deploy + # branches: [master] + branches: [elr/gh-action-dev-deploy] -# env: -# AZURE_WEBAPP_NAME: clearlydefined-api-dev -# # AZURE_WEBAPP_PACKAGE_PATH: '.' # TODO: confirm that root is the webapp root (default is root) -# NODE_VERSION: '18' # TODO: does this need to have a minor version? +env: + AZURE_WEBAPP_NAME: clearlydefined-api-dev + DOCKER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/${{ github.repository }}-dev jobs: build-and-deploy: @@ -31,15 +31,15 @@ jobs: push: true file: DevDockerfile tags: | - ghcr.io/${{ github.repository_owner }}/${{ github.repository }}-dev:latest - ghcr.io/${{ github.repository_owner }}/${{ github.repository }}-dev:${{ github.sha }} + ${{ env.DOCKER_IMAGE_NAME }}:latest + ${{ env.DOCKER_IMAGE_NAME }}:${{ github.sha }} labels: | env=dev type=api - # - name: 'Deploy to Azure WebApp' - # uses: azure/webapps-deploy@v2 - # with: - # app-name: ${{ env.AZURE_WEBAPP_NAME }} - # publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} - # # package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} # TODO: uncomment if determined that root is not the webapp root + - name: 'Deploy to Azure WebApp' + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + images: ${{ env.DOCKER_IMAGE_NAME }}:latest