-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (44 loc) · 1.79 KB
/
deploy.yml
File metadata and controls
57 lines (44 loc) · 1.79 KB
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
name: Deploy
on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Clone publish
run: |
git clone --depth 1 --branch publish https://github.com/uazo/superpatch out/wwwroot
rm -r out/wwwroot/*
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1.8.2
- name: Build & Publish (www)
run: dotnet publish -c Release -o out SuperPatch/SuperPatch.csproj
- name: Build & Publish (bin)
run: dotnet publish -c Release -o bin SuperPatchUtils/SuperPatchUtils.csproj
# changes the base-tag in index.html from '/' to 'BlazorGitHubPagesDemo' to match GitHub Pages repository subdirectory
- name: Change base-tag in index.html from / to superpatch
run: sed -i 's/<base href="\/" \/>/<base href="\/superpatch\/" \/>/g' out/wwwroot/index.html
# add .nojekyll file to tell GitHub pages to not treat this as a Jekyll project. (Allow files and folders starting with an underscore)
- name: Add .nojekyll file
run: touch out/wwwroot/.nojekyll
# copy index.html to 404.html to serve the same file when a file is not found
- name: copy index.html to 404.html
run: cp out/wwwroot/index.html out/wwwroot/404.html
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3.10.1
with:
base: publish
path: out/wwwroot
delete-branch: true
branch-suffix: short-commit-hash
- name: Publish bin
uses: actions/upload-artifact@v4
with:
name: SuperPatchUtils
path: bin