mirror of
https://github.com/Polaris-Entertainment/bytefy.git
synced 2026-04-09 09:29:39 +00:00
66 lines
1.9 KiB
YAML
66 lines
1.9 KiB
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master # Change to your default branch if different
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: self-hosted # Ensure your self-hosted runner is configured
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up .NET
|
|
uses: actions/setup-dotnet@v2
|
|
with:
|
|
dotnet-version: '8.0' # Change to your required .NET version
|
|
|
|
- name: Restore .NET Dependencies
|
|
run: dotnet restore ./services/bytefy.image/bytefy.image/bytefy.image.csproj
|
|
|
|
- name: Build .NET Project
|
|
run: dotnet build --configuration Release ./services/bytefy.image/bytefy.image/bytefy.image.csproj
|
|
|
|
- name: Publish .NET Project
|
|
run: dotnet publish ./services/bytefy.image/bytefy.image/bytefy.image.csproj --configuration Release --output ./output/dotnet
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '22.1.0' # Change to your required Node.js version
|
|
|
|
- name: Install Angular CLI
|
|
run: npm install -g @angular/cli
|
|
|
|
- name: Install Angular Dependencies
|
|
run: |
|
|
cd ./tools
|
|
npm install --force
|
|
|
|
- name: Build Angular App
|
|
run: |
|
|
cd ./tools
|
|
ng build --configuration production --output-path=dist
|
|
|
|
deploy:
|
|
runs-on: self-hosted # Ensure your self-hosted runner is configured
|
|
needs: build
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Copy .NET Publish Files to IIS Server
|
|
run: |
|
|
xcopy ./output/dotnet/* "C:\inetpub\applications\bytefy.image" /s /i /y
|
|
xcopy bytefy\bytefy\tools\dist\* "C:\inetpub\wwwroot\bytefy" /s /i /y
|
|
|
|
- name: Restart IIS
|
|
run: |
|
|
Import-Module WebAdministration
|
|
Restart-WebAppPool -Name "Bytefy" # Change to your App Pool Name
|
|
Restart-WebAppPool -Name "Bytefy.image" # Change to your App Pool Name
|