Skip to content

Add Surge.sh PR preview deployments #148

Add Surge.sh PR preview deployments

Add Surge.sh PR preview deployments #148

Workflow file for this run

name: .NET Core
on:
push:
branches: [ master ]
repository_dispatch:
types: content-changed
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
- name: Publish
run: dotnet publish PetrSvihlik.Com.csproj --configuration Release --no-build -o ./tools
- name: "Artifact : generator"
uses: actions/upload-artifact@v7
with:
name: "Generator"
path: ./tools
- name: Publish
run: dotnet run --configuration Release
env:
LinkRoot: ${{ secrets.LINKROOT }} # Fix subfolder links https://statiq.dev/framework/configuration/settings
Host: ${{ secrets.HOST }} # Make links absolute (for feeds, OG...)
- name: Index with Pagefind
run: npx pagefind --site output
- name: "Artifact : site"
uses: actions/upload-artifact@v7
with:
name: "Site"
path: ./output
- name: Deploy 🚀
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@v4.8.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: output
clean: true # Automatically remove deleted files from the deploy branch