[Upgrade]: handle navbar page admin to view component #20
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 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 |