Skip to content

Update 10-Registro de Testes de Sistema.md #47

Update 10-Registro de Testes de Sistema.md

Update 10-Registro de Testes de Sistema.md #47

# 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 - pagai-frontend
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read #This is required for actions/checkout
steps:
- uses: actions/checkout@v4
- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: '22.x'
- name: npm install, build, and test
working-directory: src/frontend
env:
VITE_GATEWAY_URL: https://gateway-hxc8cshmfsd9cwdt.eastus-01.azurewebsites.net
VITE_API_URL: https://gateway-hxc8cshmfsd9cwdt.eastus-01.azurewebsites.net/backend/Usuarios
VITE_EMPRESTIMOS_URL: https://gateway-hxc8cshmfsd9cwdt.eastus-01.azurewebsites.net/backend/Emprestimos
VITE_CLIENTES_URL: https://gateway-hxc8cshmfsd9cwdt.eastus-01.azurewebsites.net/backend/Clientes
VITE_NOTIFICACOES_URL: https://gateway-hxc8cshmfsd9cwdt.eastus-01.azurewebsites.net/backend/Notificacoes
VITE_REPORTS_URL: https://gateway-hxc8cshmfsd9cwdt.eastus-01.azurewebsites.net/backend/Report
run: |
npm install --legacy-peer-deps
npm run build
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: node-app
path: src/frontend/dist
deploy:
runs-on: ubuntu-latest
needs: build
permissions:
id-token: write #This is required for requesting the JWT
contents: read #This is required for actions/checkout
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_6254BB39E97E4467ACCF7E06D4D08C16 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_456B0FEF175C480284C69FA60D1BF734 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_07B196A1D4F047E8B4C18E4045EB9FF2 }}
- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: 'pagai-frontend'
slot-name: 'Production'
package: .