Skip to content

Merge branch 'flowbytedev:main' into main #4

Merge branch 'flowbytedev:main' into main

Merge branch 'flowbytedev:main' into main #4

name: Deploy APP to IIS
on:
workflow_dispatch:
push:
branches: [ dev, main ]
# Only trigger the workflow if changes occur in the 'Application' folder (including all subfolders and files)
paths:
- 'Application/**'
- 'Application.Client/**'
- 'Application.Shared/**'
jobs:
build:
runs-on: spinsrv3
steps:
- uses: actions/checkout@v2
# removed the dotnet setup. because the self hosted agent already has the dotnet installed.
# - name: Setup .NET Core
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: 9.x.x
- name: Build with dotnet
shell: cmd
run: dotnet build Application/Application.csproj --configuration Release
# dependecy on the build job
deploy:
runs-on: spinsrv3
# Dynamically pick environment: if branch is 'dev', use 'test'; else use 'prod'
environment: ${{ github.ref_name == 'dev' && 'test' || 'prod' }}
needs: build
steps:
- uses: actions/checkout@v2
- name: Publish with dotnet
shell: cmd
run: dotnet publish Application/Application.csproj --configuration Release --output .\myapp #./publish
- name: Deploy to IIS
shell: cmd
run: |
iisreset /stop
xcopy /s /y .\myapp\* C:\inetpub\wwwroot\${{ secrets.APP_IIS_PATH }}\
iisreset /start