Merge branch 'flowbytedev:main' into main #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |