From cd0c94da6ad6cc5beea25ce0878ee51b386f68c9 Mon Sep 17 00:00:00 2001 From: ivyvanzant Date: Tue, 19 Nov 2024 09:55:37 -0800 Subject: [PATCH] modified deployment workflow to work with monorepo --- .github/workflows/backend_focusfruit.yml | 31 ++++++++++++++---------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/backend_focusfruit.yml b/.github/workflows/backend_focusfruit.yml index 8d9ae7d..ac37edc 100644 --- a/.github/workflows/backend_focusfruit.yml +++ b/.github/workflows/backend_focusfruit.yml @@ -23,14 +23,19 @@ jobs: - name: npm install, build, and test run: | - npm install - npm run build --if-present - npm run test --if-present + npm install --workspaces=false + npm run -w express-backend build --if-present + npm run -w express-backend test --if-present + working-directory: packages/express-backend + + - name: Zip artifact for deployment + run: zip release.zip ./* -r + working-directory: packages/express-backend - name: Upload artifact for deployment job uses: actions/upload-artifact@v4 with: - name: node-app + name: node-appb path: . deploy: @@ -39,21 +44,21 @@ jobs: environment: name: 'Production' url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - permissions: - id-token: write #This is required for requesting the JWT + permissions: + id-token: write #This is required for requesting the JWT steps: - name: Download artifact from build job uses: actions/download-artifact@v4 with: name: node-app - - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_290EF528711248B6AB538DE20E380C7C }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_EA503942294841D9B9320C5CE49A36E3 }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_377FE0A7E8154614A9075E7EFFF0FB94 }} + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_290EF528711248B6AB538DE20E380C7C }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_EA503942294841D9B9320C5CE49A36E3 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_377FE0A7E8154614A9075E7EFFF0FB94 }} - name: 'Deploy to Azure Web App' uses: azure/webapps-deploy@v3