Lesson 37 of 40
DevOps
Intermediate
35 min
CI/CD with GitHub Actions from VS 2026
Automate builds, tests, and deployments with GitHub Actions workflows created and managed from VS 2026's integrated CI/CD tooling.
Part 1: Generated Workflow Starters
VS 2026 detects your project type and generates appropriate workflow starters. For an ASP.NET Core API:
name: .NET CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
- run: dotnet test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
- run: dotnet test
Part 2: Multi-Stage Pipelines
jobs:
test: { ... }
publish:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- run: dotnet publish -c Release
- uses: azure/webapps-deploy@v3
test: { ... }
publish:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- run: dotnet publish -c Release
- uses: azure/webapps-deploy@v3
Part 3: Reusable Workflows
# .github/workflows/run-tests.yml
on:
workflow_call:
inputs:
dotnet-version: { type: string }
# Call it from another workflow:
uses: ./.github/workflows/run-tests.yml
with: { dotnet-version: '10.0' }
on:
workflow_call:
inputs:
dotnet-version: { type: string }
# Call it from another workflow:
uses: ./.github/workflows/run-tests.yml
with: { dotnet-version: '10.0' }
Part 4: Secrets & Environment Protection
- Store secrets in GitHub → Settings → Secrets
- Reference as
${{ secrets.AZURE_CREDENTIALS }} - Environment protection rules: require approval before prod deploy
- VS 2026 shows secret names (never values) in workflow editor