39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
name: Deploy React App to Azure Web App
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # oder dein Branch
|
|
workflow_dispatch: # Ermöglicht manuelles Triggern
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18'
|
|
cache: 'npm' # Aktiviert Caching für schnellere Builds
|
|
|
|
- name: Install dependencies
|
|
run: npm ci # Nutzt package-lock.json für deterministische Installs
|
|
|
|
- name: Build React app
|
|
run: npm run build
|
|
env:
|
|
CI: false # Verhindert, dass Warnungen den Build stoppen
|
|
|
|
- name: Copy web.config to build folder
|
|
run: cp web.config build/
|
|
|
|
- name: 'Deploy to Azure Web App'
|
|
uses: azure/webapps-deploy@v3
|
|
with:
|
|
app-name: 'poweron-nyla'
|
|
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D6C9359A57C5448A8C0BFA2D4C4B2068 }}
|
|
package: ./build # Spezifiziert den Build-Ordner der React-App
|