Skip to content

Cleanup Directory.Packages.props #42

Cleanup Directory.Packages.props

Cleanup Directory.Packages.props #42

Workflow file for this run

name: Deploy demo to static pages
on:
push:
branches:
- master
- wasm-demo
env:
PUBLISH_DIR: Material.Avalonia.Demo.Browser/bin/Release/net8.0-browser/browser-wasm/AppBundle/
jobs:
# Build job
build:
name: "Builds a Material.Avalonia.Demo.Browser"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v3
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
- name: 'Install workload: wasm-tools'
run: dotnet workload install wasm-tools
- name: 'Publish Material.Avalonia.Demo.Browser'
run: dotnet publish Material.Avalonia.Demo.Browser/Material.Avalonia.Demo.Browser.csproj -c Release
- name: Fix permissions
run: |
chmod -c -R +rX "${{ env.PUBLISH_DIR }}" | while read line; do
echo "::info title=Invalid file permissions automatically fixed::$line"
done
- name: Rewrite base href
uses: SteveSandersonMS/ghaction-rewrite-base-href@v1
with:
html_path: ${{ env.PUBLISH_DIR }}/index.html
base_href: /Material.Avalonia/
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.PUBLISH_DIR }}
# Deploy job
deploy:
name: "Deploy Material.Avalonia.Demo.Browser to GitHub Pages"
# Add a dependency to the build job
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action