Release v0.4.0 hotfix 1 #56
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: .NET Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
- dev | |
workflow_dispatch: | |
inputs: | |
releasePage: | |
description: 'Release to GitHub Pages? (Y/N)' | |
required: false | |
default: 'N' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Install Excubo.WebCompiler | |
run: dotnet tool install Excubo.WebCompiler --global | |
- name: Install dependencies | |
run: dotnet restore | |
- name: 'Compile Static Files: /wwwroot/css' | |
run: webcompiler -r Randominator/wwwroot/css -c Randominator/webcompiler.json | |
- name: 'Compile Static Files: /UI' | |
run: webcompiler -r Randominator/UI -c Randominator/webcompiler.json | |
- name: Publish solution | |
run: dotnet publish Randominator --no-restore --nologo -c Release -o /home/runner/work/output | |
- name: Run tests | |
run: dotnet test --no-restore --nologo --verbosity normal | |
- name: Version static files | |
uses: jacobtomlinson/gha-find-replace@v2 | |
with: | |
find: '(?i)%%VERSION%%' | |
replace: ${{ github.run_id }} | |
regex: true | |
include: '/home/runner/work/output/wwwroot/**.html' | |
- name: Create 404.html | |
run: 'cp -p -n /home/runner/work/output/wwwroot/index.html /home/runner/work/output/wwwroot/404.html' | |
- name: Generate robots.txt | |
run: 'dotnet run --project Randominator.SitemapRenderer -- -o /home/runner/work/output/wwwroot' | |
- name: Release to GitHub Pages | |
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event.inputs.releasePage == 'Y' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: /home/runner/work/output/wwwroot | |
cname: randominator.tehgm.net | |
force_orphan: true | |
- name: Ping Google | |
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event.inputs.releasePage == 'Y' | |
run: 'curl https://www.google.com/ping?sitemap=https://randominator.tehgm.net/sitemap.xml' | |
- name: Ping Bing | |
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event.inputs.releasePage == 'Y' | |
run: 'curl https://www.bing.com/ping?sitemap=https://randominator.tehgm.net/sitemap.xml' | |