-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (49 loc) · 1.48 KB
/
main.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
name: UnoPages App
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
workflow_dispatch: # Allows workflow to be run via a button
jobs:
build:
runs-on: ubuntu-latest
name: Build
env:
config: 'Release'
framework: 'net6.0'
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore Dependencies
run: dotnet restore ./MarkNobleUno6/MarkNobleUno6.Wasm/MarkNobleUno6.Wasm.csproj
- name: Build
run: dotnet build ./MarkNobleUno6/MarkNobleUno6.Wasm/MarkNobleUno6.Wasm.csproj --no-restore -f $framework -c $config
- name: Publish Artifacts
uses: actions/[email protected]
if: github.event_name == 'workflow_dispatch' # Only deploy if Workflow manually ran
with:
name: pages
path: ./MarkNobleUno6/MarkNobleUno6.Wasm/bin/${{env.config}}/${{env.framework}}/dist/
deploy:
needs: build
runs-on: ubuntu-latest
name: Deploy
if: github.event_name == 'workflow_dispatch' # Only deploy if Workflow manually ran
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: pages
path: dist
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: ./dist/
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}