-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (33 loc) · 1.2 KB
/
Deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Build and Deploy Static Site to GitHub Pages
on:
push:
branches:
- main # Replace with your default branch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.x' # Replace with your .NET version
- name: Restore dependencies
run: dotnet restore
- name: Build the project
run: dotnet build --configuration Release
- name: Publish the project
run: dotnet publish --configuration Release --output ./publish
- name: Generate static content
run: |
# Assuming you generate static files into the docs folder
# You might need a custom script to generate HTML from your Razor views.
# Here, we copy the content from publish to the docs folder as an example.
mkdir -p ./docs
cp -r ./publish/* ./docs/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs # Directory where the static files are generated