-
Notifications
You must be signed in to change notification settings - Fork 76
71 lines (64 loc) · 2.69 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Deploy demo to static pages
on:
push:
branches:
- master
- wasm-demo
env:
PUBLISH_DIR: Material.Avalonia.Demo.Browser/bin/Release/net8.0/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