frontend_nyla/.github/workflows/int_poweron-nyla-int.yml

73 lines
No EOL
2.2 KiB
YAML

name: Build and deploy Nyla App to int
on:
push:
branches:
- int
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js version
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Create production environment file
run: |
echo 'VITE_API_BASE_URL="https://gateway-int.poweron-center.net"' > .env.production
echo 'VITE_MICROSOFT_CLIENT_ID="24cd6c8a-b592-4905-a5ba-d5fa9f911154"' >> .env.production
echo 'VITE_MICROSOFT_TENANT_ID="6a51aaeb-2467-4186-9504-2a05aedc591f"' >> .env.production
echo 'VITE_ENTRA_CLIENT_SECRET="2iw8Q~jwqG1iacxHopBt5pstu6R45UC1gIQabcbD"' >> .env.production
echo 'VITE_ENTRA_AUTHORITY="https://login.microsoftonline.com/6a51aaeb-2467-4186-9504-2a05aedc591f"' >> .env.production
echo 'VITE_ENTRA_REDIRECT_PATH="/auth/callback/"' >> .env.production
echo 'VITE_ENTRA_REDIRECT_URI="https://gateway-int.poweron-center.net/api/msft/auth/callback/"' >> .env.production
- name: npm install, build
run: |
npm ci
npm run build --if-present
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: node-app
path: |
.
!node_modules
!.git
!.github
!README.md
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@v1
with:
creds: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_POWERON_NYLA_INT }}
- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'poweron-nyla-int'
slot-name: 'Production'
package: .