Bump NUnit from 4.2.1 to 4.2.2 (#24) #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build site, deploy to Azure, scan with Dastardly | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-and-test: | |
name: Build and test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
dotnet-quality: 'ga' | |
- name: Build with dotnet | |
run: dotnet build -c Release | |
- name: Test with dotnet | |
run: dotnet test -c Release | |
- name: dotnet publish | |
run: dotnet publish VulnerableSite -c Release -o ${{env.DOTNET_ROOT}}/myapp | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v4 | |
with: | |
name: .net-app | |
path: ${{env.DOTNET_ROOT}}/myapp | |
deploy-to-azure: | |
name: Deploy to Azure | |
runs-on: ubuntu-latest | |
needs: build-and-test | |
environment: | |
name: 'Production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v4 | |
with: | |
name: .net-app | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: 'vulnerable-site' | |
slot-name: 'Production' | |
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_4080FF02C6844229A0E0EB0ED16426F0 }} | |
package: . | |
scan-with-dastardly: | |
name: Scan with Dastardly | |
runs-on: ubuntu-latest | |
needs: deploy-to-azure | |
steps: | |
- name: Run Dastardly Scan | |
uses: PortSwigger/dastardly-github-action@main | |
with: | |
target-url: 'https://vulnerable-site.azurewebsites.net/' | |
- name: Publish Dastardly Scan Report | |
if: always() | |
uses: mikepenz/action-junit-report@v4 | |
with: | |
check_name: 'Dastardly Scan Report' | |
report_paths: '**/dastardly-report.xml' | |
require_tests: true |