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 Actio…


This content originally appeared on DEV Community and was authored by Jawad Hayat

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

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


This content originally appeared on DEV Community and was authored by Jawad Hayat


Print Share Comment Cite Upload Translate Updates
APA

Jawad Hayat | Sciencx (2024-07-02T07:57:29+00:00) My Learning Journey in CI/CD with Local IIS Server. Retrieved from https://www.scien.cx/2024/07/02/my-learning-journey-in-ci-cd-with-local-iis-server/

MLA
" » My Learning Journey in CI/CD with Local IIS Server." Jawad Hayat | Sciencx - Tuesday July 2, 2024, https://www.scien.cx/2024/07/02/my-learning-journey-in-ci-cd-with-local-iis-server/
HARVARD
Jawad Hayat | Sciencx Tuesday July 2, 2024 » My Learning Journey in CI/CD with Local IIS Server., viewed ,<https://www.scien.cx/2024/07/02/my-learning-journey-in-ci-cd-with-local-iis-server/>
VANCOUVER
Jawad Hayat | Sciencx - » My Learning Journey in CI/CD with Local IIS Server. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/02/my-learning-journey-in-ci-cd-with-local-iis-server/
CHICAGO
" » My Learning Journey in CI/CD with Local IIS Server." Jawad Hayat | Sciencx - Accessed . https://www.scien.cx/2024/07/02/my-learning-journey-in-ci-cd-with-local-iis-server/
IEEE
" » My Learning Journey in CI/CD with Local IIS Server." Jawad Hayat | Sciencx [Online]. Available: https://www.scien.cx/2024/07/02/my-learning-journey-in-ci-cd-with-local-iis-server/. [Accessed: ]
rf:citation
» My Learning Journey in CI/CD with Local IIS Server | Jawad Hayat | Sciencx | https://www.scien.cx/2024/07/02/my-learning-journey-in-ci-cd-with-local-iis-server/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.