Explorar o código

Added github action for deploying to pages

Tim Jones hai 1 mes
pai
achega
c144fe1c8e
Modificáronse 3 ficheiros con 56 adicións e 0 borrados
  1. BIN=BIN
      .DS_Store
  2. 56 0
      .github/workflows/publish-demo.yml
  3. BIN=BIN
      vhs/.DS_Store

BIN=BIN
.DS_Store


+ 56 - 0
.github/workflows/publish-demo.yml

@@ -0,0 +1,56 @@
+name: Deploy Blazor WASM to GitHub Pages
+
+on:
+  push:
+    branches: [ "main" ]
+  workflow_dispatch:
+
+permissions:
+  contents: read
+  pages: write
+  id-token: write
+
+concurrency:
+  group: "pages"
+  cancel-in-progress: true
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      - name: Setup .NET
+        uses: actions/setup-dotnet@v4
+        with:
+          dotnet-version: 10.0.x
+
+      - name: Restore
+        run: dotnet restore ./RackPeek.Web.Viewer/RackPeek.Web.Viewer.csproj
+
+      - name: Publish Blazor WASM
+        run: dotnet publish ./RackPeek.Web.Viewer/RackPeek.Web.Viewer.csproj -c Release -o publish
+
+      # Optional but recommended for GitHub Pages routing
+      - name: Add SPA fallback
+        run: cp publish/wwwroot/index.html publish/wwwroot/404.html
+
+      - name: Upload Pages artifact
+        uses: actions/upload-pages-artifact@v3
+        with:
+          path: publish/wwwroot
+
+  deploy:
+    environment:
+      name: github-pages
+      url: ${{ steps.deployment.outputs.page_url }}
+
+    runs-on: ubuntu-latest
+    needs: build
+
+    steps:
+      - name: Deploy to GitHub Pages
+        id: deployment
+        uses: actions/deploy-pages@v4

BIN=BIN
vhs/.DS_Store