title: Publish ASP.NET Core to IIS with GITLAB CI/CD
body: <p>I can run the web application by using <code>dotnet run</code> on the <code>.gitlab-ci.yml</code> script.</p>
  <pre><code>stages:
      - build
  build:
      stage: build
      before_script:
          - 'dotnet restore'
      script:
          - echo &quot;Building the My Application&quot;
          - &quot;dotnet publish Eitms.Decoder.sln -c release&quot;
          - &quot;cd C:\\MyFolderContaints\\Eitms.Decoder.Backend&quot;
          - &quot;dotnet run&quot;
      only:
          - release
  </code></pre>
  <p>But how I can publish into the IIS? anyone can show the step?</p>
  <p>Thanks</p>
  <h1>UPDATE</h1>
  <p>After view the script from <a href="https://stackoverflow.com/questions/47311770/dotnet-publish-with-gitlab-ci-for-dummies">HERE</a>, still not success yet. Did I do something wrong here?</p>
  <pre><code>stages:
      - build    
      - deploy
  build:
      stage: build
      before_script:
          - 'dotnet restore'
      script:
          - echo &quot;Building the app&quot;
          - &quot;dotnet publish Eitms.Decoder.sln -c release&quot;
      artifacts:
          untracked: true
      only:
          - release
  
  deploy_staging:
      stage: deploy
      script:
          - echo &quot;Deploy to IIS&quot;
          - &quot;dotnet publish Eitms.Decoder.Backend\\Eitms.Decoder.Backend.csproj -c release -o C:\\Secret Path\\PRODUCTION\\Secret Project&quot;
      dependencies:
          - build
      only:
          - release
  </code></pre>