57
.github/workflows/deploy.yml
vendored
57
.github/workflows/deploy.yml
vendored
@@ -1,8 +1,8 @@
|
|||||||
name: Deploy to GitHub Pages
|
name: Deploy to GitHub Pages
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PROJECT_PATH: demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj
|
PROJECT_PATH: demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj
|
||||||
OUTPUT_PATH: demo/Ursa.Demo.Browser/bin/Debug/net7.0/browser-wasm/AppBundle
|
OUTPUT_PATH: demo/Ursa.Demo.Browser/bin/Release/net7.0/browser-wasm/AppBundle
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "deploy" ]
|
branches: [ "deploy" ]
|
||||||
@@ -13,38 +13,41 @@ jobs:
|
|||||||
deploy-to-github-pages:
|
deploy-to-github-pages:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
- name: Setup .NET Core SDK
|
- name: Setup .NET 7
|
||||||
uses: actions/setup-dotnet@v1.9.0
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: 7.0.405
|
||||||
|
|
||||||
- name: Install wasm-tools
|
- name: Install wasm-tools
|
||||||
run: dotnet workload install wasm-tools wasm-experimental
|
run: dotnet workload install wasm-tools wasm-tools-net7
|
||||||
|
|
||||||
- name: Install DotNetCompress
|
- name: Install DotNetCompress
|
||||||
run: dotnet tool install --global DotNetCompress --version 2.0.0 --no-cache
|
run: dotnet tool install --global DotNetCompress --version 3.0.0 --no-cache
|
||||||
|
|
||||||
- name: Publish .NET Project
|
- name: Publish .NET Project
|
||||||
run: dotnet publish $PROJECT_PATH -c Debug -o debug --nologo
|
run: dotnet publish $PROJECT_PATH -c Release -o release --nologo
|
||||||
|
|
||||||
- name: Change base-tag in index.html
|
- name: Change base-tag in index.html
|
||||||
run: sed -i 's/<base href="\/" \/>/<base href="\/Ursa.Avalonia\/" \/>/g' $OUTPUT_PATH/index.html
|
run: sed -i 's/<base href="\/" \/>/<base href="\/Ursa.Avalonia\/" \/>/g' $OUTPUT_PATH/index.html
|
||||||
|
|
||||||
- name: copy index.html to 404.html
|
- name: copy index.html to 404.html
|
||||||
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html
|
run: cp $OUTPUT_PATH/index.html $OUTPUT_PATH/404.html
|
||||||
|
|
||||||
- name: Compress Output using Brotli
|
- name: Compress Output using Brotli
|
||||||
run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format br --threads 4
|
run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format br --threads 4
|
||||||
|
|
||||||
- name: Compress Output using GZip
|
- name: Compress Output using GZip
|
||||||
run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format gz --threads 4
|
run: DotNetCompress -d $OUTPUT_PATH -p "*.dll" "*.js" "*.wasm" --format gz --threads 4
|
||||||
|
|
||||||
- name: Add .nojekyll file
|
- name: Add .nojekyll file
|
||||||
run: touch $OUTPUT_PATH/.nojekyll
|
run: touch $OUTPUT_PATH/.nojekyll
|
||||||
|
|
||||||
- name: Commit wwwroot to GitHub Pages
|
- name: Commit wwwroot to GitHub Pages
|
||||||
uses: JamesIves/github-pages-deploy-action@4.1.7
|
uses: JamesIves/github-pages-deploy-action@v4.5.0
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
BRANCH: gh-pages
|
BRANCH: gh-pages
|
||||||
FOLDER: ${{ env.OUTPUT_PATH }}
|
FOLDER: ${{ env.OUTPUT_PATH }}
|
||||||
|
|||||||
Reference in New Issue
Block a user