DEV Community

Jawad Hayat
Jawad Hayat

Posted on

4

My Learning Journey in CI/CD with Local IIS Server

As a backend developer, I recently dived into the world of CI/CD while working with Angular. Here’s a quick overview of my process:

1. Create a Web API Project: Started with a new project and pushed the code to a GitHub repo.
2. Configure GitHub Actions: Set up the .NET build and test action by creating a workflow directory and a YAML file in .github.
3. Set Up Self-Hosted Runner:

  • Configured a new runner in GitHub Actions settings.
  • Ran provided commands in PowerShell as an administrator to set up the runner locally.
  • Verified the runner is working correctly in GitHub Actions settings. 4. Test the Configuration: Pushed changes to the master branch to ensure the jobs run successfully. 5. Install IIS Server: Created a website and bound it to a physical path on my PC. 6. Publish and Deploy Logic: Updated the YAML file for publishing and deploying to IIS.

Here’s the YAML script I used:

name: .NET

on:
 push:
 branches: [ "master" ]
 pull_request:
 branches: [ "master" ]

jobs:
 build-and-deploy:

 runs-on: self-hosted

 steps:
 - uses: actions/checkout@v4
 - name: Restore dependencies
 run: dotnet restore
 - name: Build
 run: dotnet build --no-restore
 - name: Test
 run: dotnet test --no-build --verbosity normal
 - name: Publish
 run: dotnet publish -c Debug -o dotnetcorewebapp .
 - name: Stop IIS
 run: iisreset /stop
 - name: Deploy to IIS
 run: Copy-Item -Path {Your Path}\* -Destination {Your Path} -Recurse -Force
 - name: List files in IIS
 run: Get-ChildItem -Path {Your Path} -Recurse
 - name: Start IIS
 run: iisreset /start
Enter fullscreen mode Exit fullscreen mode

This journey has been a fantastic learning experience, enhancing my skills in automation and deployment. Looking forward to more such explorations!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more