Skip to content

Merge branch 'backend' of github.com:tomaseuu/project-pomodoro into b… #4

Merge branch 'backend' of github.com:tomaseuu/project-pomodoro into b…

Merge branch 'backend' of github.com:tomaseuu/project-pomodoro into b… #4

# 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 - focusfruit
on:
push:
branches:
- backend
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: npm install, build, and test
run: |
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-appb
path: packages/express-backend/release.zip
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
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: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v3
id: deploy-to-webapp
with:
app-name: 'focusfruit'
slot-name: 'Production'
package: .