Skip to content

Commit

Permalink
FINALLY
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaloney111 committed Jun 6, 2024
1 parent 0f180f6 commit a845b0c
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/main_safehaven2.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -21,33 +18,51 @@ 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
uses: actions/download-artifact@v3
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:
Expand All @@ -61,4 +76,4 @@ jobs:
with:
app-name: 'SafeHaven2'
slot-name: 'Production'
package: .
package: node-app/packages/express-backend

0 comments on commit a845b0c

Please sign in to comment.