GitHub Actions Workshop

Master GitHub Actions with hands-on labs and exercises. Learn how to automate workflows, run tests, deploy applications, and more using GitHub's powerful automation platform. This repository has everything you need to get started with continuous integration and continuous deployment.


Project maintained by prasadhonrao Hosted on GitHub Pages — Theme by mattgraham

Starter File: ASP.NET Web App Deploy to Azure Using Shared Workflow

name: ASP.NET Web App Deploy to Azure
on:
  push:
    paths:
      - '.github/workflows/aspnet-webapp-deploy.yml'
      - 'src/dotnet/WebApp/**'

env:
  AZURE_WEBAPP_NAME: github-actions-workshop-aspnet-webapp
  AZURE_WEBAPP_PACKAGE_PATH: ./published
  CONFIGURATION: Release
  DOTNET_CORE_VERSION: 8.0.x
  WORKING_DIRECTORY: 'src/dotnet/WebApp'
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup .NET SDK
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: $
      - name: Verify Working Directory
        run: |
          echo "Current Directory: $(pwd)"
          ls $
      - name: Restore dependencies
        run: dotnet restore $
      - name: Build
        run: dotnet build "$" --configuration $ --no-restore
      - name: Publish
        run: dotnet publish "$" --configuration $ --output "$"
      - name: Publish Artifacts
        uses: actions/upload-artifact@v4
        with:
          name: webapp
          path: $
  deploy: