Merge pull request #400 from AvaloniaCommunity/warningsCleanup #63
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: Deploy demo to static pages | |
on: | |
push: | |
branches: | |
- master | |
- wasm-demo | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
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 |