Hi AWS, I am building a CI/CD pipeline for the .NET web app and while deploying the app to IIS server I am facing this issue as highlighted in the screenshot. Having said that the GitHub Actions runner is configured on AWS EC2 Windows instance using amazon/Windows_Server-2022-English-Full-Base-2023.08.10
AMI.
This is the pipeline code:
name: "Deploying a CI/CD for .NET sample app using GitHub Actions"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: [ self-hosted, Windows, X64 ]
steps:
- name: Checkout code repository
uses: actions/checkout@v3
- name: Install .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0'
include-prerelease: True
- name: Display dotnet version
run: dotnet --version
- name: Restore dependencies
run: dotnet restore
# dotnet build and publish
- name: Build with dotnet
run: dotnet build --configuration Release --no-restore
- name: dotnet publish
run: |
dotnet publish --configuration Release --no-restore
# IIS Deployment
- name: Deploy to IIS Server
run: |
iisreset /stop
Copy-Item ./MyWebApp/* C:/inetpub/wwwroot/MyWebApp -Recurse -Force
iisreset /start
# - name: Curl the website as a smoke test
# run: curl http://localhost/
# - name: Run Web Test
# run: |
# dotnet build --configuration Release .\dotnet-core-webapp.webtest
# cd .\dotnet-core-webapp.webtests
# dotnet test
# - name: Test
# run: dotnet test --no-build --verbosity normal
# - name: Run the WebApp
# run: dotnet watch