-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: [ deploy ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy-to-github-pages: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '8.0.x' | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore Voxel2Pixel.sln | ||
|
||
- name: Build | ||
run: dotnet build Voxel2Pixel.sln --configuration Release --no-restore | ||
|
||
- name: Publish | ||
run: dotnet publish Voxel2Pixel.Web/Voxel2Pixel.Web.csproj -c Release -o release --nologo | ||
|
||
# Changes the base tag in index.html from '/' to '/Voxel2Pixel/' to match GitHub Pages repository subdirectory | ||
- name: Change base-tag in index.html | ||
run: sed -i 's/<base href="\/" \/>/<base href="\/Voxel2Pixel\/" \/>/g' release/wwwroot/index.html | ||
|
||
# Add .nojekyll file to tell GitHub pages not to run Jekyll processing | ||
- name: Add .nojekyll file | ||
run: touch release/wwwroot/.nojekyll | ||
|
||
- name: Commit to GitHub Pages | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: release/wwwroot | ||
branch: gh-pages |