Skip to content

Add changes to make it work on .NET 8 RC 2 #104

Add changes to make it work on .NET 8 RC 2

Add changes to make it work on .NET 8 RC 2 #104

name: Build and deploy to Netlify
on: [push]
env:
ASPNETCORE_ENVIRONMENT: 'Action'
jobs:
deployCommitDraft:
name: Deploy draft to Netlify
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref != 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup npm
uses: actions/setup-node@v2
with:
node-version: 17.1.0
- run: npm ci
- run: npm run prodbuild
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.100
- name: Add robots.txt disallow
shell: pwsh
run: |
Set-Content "./src/Krompaco.RecordCollector.Web/wwwroot/robots.txt" "User-agent: *`r`nDisallow: /"
- name: Generate static site
run: dotnet test ./src/Krompaco.RecordCollector.Generator/Krompaco.RecordCollector.Generator.csproj --logger "console;verbosity=detailed"
- name: Publish draft to Netlify
uses: nwtgck/actions-netlify@v1.2
with:
publish-dir: './artifacts/static-site'
enable-commit-comment: true
production-deploy: false
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
publishMasterCommit:
name: Publish to Netlify
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup npm
uses: actions/setup-node@v2
with:
node-version: 17.1.0
- run: npm ci
- run: npm run prodbuild
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.100
- name: Add robots.txt disallow
shell: pwsh
run: |
Set-Content "./src/Krompaco.RecordCollector.Web/wwwroot/robots.txt" "User-agent: *`r`nDisallow: /"
- name: Generate static site
run: dotnet test ./src/Krompaco.RecordCollector.Generator/Krompaco.RecordCollector.Generator.csproj --logger "console;verbosity=detailed"
- name: Publish to Netlify production
uses: nwtgck/actions-netlify@v1.2
with:
publish-dir: './artifacts/static-site'
enable-commit-comment: true
production-deploy: true
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}