From a845b0c056ce4737272847a7b522b2dfcf9e8778 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 6 Jun 2024 13:36:16 -0700 Subject: [PATCH] FINALLY --- .github/workflows/main_safehaven2.yml | 31 ++++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main_safehaven2.yml b/.github/workflows/main_safehaven2.yml index e7c202c..c70e8de 100644 --- a/.github/workflows/main_safehaven2.yml +++ b/.github/workflows/main_safehaven2.yml @@ -1,6 +1,3 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# More GitHub Actions for Azure: https://github.com/Azure/actions - name: Build and deploy Node.js app to Azure Web App - SafeHaven2 on: @@ -21,26 +18,41 @@ jobs: with: node-version: '20.x' - - name: npm install, build, and test + - name: npm install run: | cd packages/express-backend npm install + npm install multer + npm install jsonwebtoken + npm install bcrypt cd ../../ + + zip-and-upload: + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Zip artifact for deployment + run: zip -r release.zip packages/express-backend + working-directory: packages/express-backend + - name: Upload artifact for deployment job uses: actions/upload-artifact@v3 with: name: node-app - path: . + path: packages/express-backend/release.zip deploy: runs-on: ubuntu-latest - needs: build + needs: zip-and-upload environment: name: 'Production' url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} permissions: - id-token: write #This is required for requesting the JWT + id-token: write # This is required for requesting the JWT steps: - name: Download artifact from build job @@ -48,6 +60,9 @@ jobs: with: name: node-app + - name: Unzip artifact + run: unzip -o node-app/release.zip -d node-app + - name: Login to Azure uses: azure/login@v1 with: @@ -61,4 +76,4 @@ jobs: with: app-name: 'SafeHaven2' slot-name: 'Production' - package: . + package: node-app/packages/express-backend