Delete main_poweron-nyla.yml
This commit is contained in:
parent
009245d12b
commit
b818bbc210
1 changed files with 0 additions and 61 deletions
61
.github/workflows/main_poweron-nyla.yml
vendored
61
.github/workflows/main_poweron-nyla.yml
vendored
|
|
@ -1,62 +1 @@
|
|||
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
|
||||
npm install express
|
||||
|
||||
- name: Build React app
|
||||
run: npm run build
|
||||
|
||||
- name: Prepare deployment package
|
||||
run: |
|
||||
# Create deployment package with build files and necessary configs
|
||||
mkdir deploy
|
||||
cp -r dist/* deploy/
|
||||
# Create a simple server.js for serving the app
|
||||
echo "const express = require('express');" > deploy/server.js
|
||||
echo "const path = require('path');" >> deploy/server.js
|
||||
echo "const app = express();" >> deploy/server.js
|
||||
echo "app.use(express.static(path.join(__dirname)));" >> deploy/server.js
|
||||
echo "app.get('/*', function(req, res) { res.sendFile(path.join(__dirname, 'index.html')); });" >> deploy/server.js
|
||||
echo "const port = process.env.PORT || 8080;" >> deploy/server.js
|
||||
echo "app.listen(port, () => console.log('Server running on port', port));" >> deploy/server.js
|
||||
# Create a new package.json for deployment
|
||||
echo '{
|
||||
"name": "frontend",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node server.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^4.18.2"
|
||||
}
|
||||
}' > deploy/package.json
|
||||
|
||||
- name: 'Deploy to Azure Web App'
|
||||
uses: azure/webapps-deploy@v3
|
||||
with:
|
||||
app-name: 'poweron-nyla'
|
||||
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D6C9359A57C5448A8C0BFA2D4C4B2068 }}
|
||||
package: ./deploy
|
||||
|
|
|
|||
Loading…
Reference in a new issue