Change version to '8.0.100-rc.2.23502.2' in GH Action #109
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 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: 18.18.2 | |
- run: npm ci | |
- run: npm run prodbuild | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '8.0.100-rc.2.23502.2' | |
- 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/[email protected] | |
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: 18.18.2 | |
- run: npm ci | |
- run: npm run prodbuild | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '8.0.100-rc.2.23502.2' | |
- 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/[email protected] | |
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 }} |