-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (73 loc) · 2.22 KB
/
dotnet.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: DeployToGitHubPages
env:
PUBLISH_DIR: ${{github.workspace}}/master/RadiocomDataViewApp/bin/Release/net5.0/publish/wwwroot
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Path
run: |
ls
pwd
- uses: actions/checkout@v2
with:
path: master
- name: Path
run: |
ls
pwd
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages
path: gh-pages
- uses: FranzDiebold/github-env-vars-action@v2.1.0
- name: GitHub Environment Variables Action
run: |
echo "CI_REPOSITORY_NAME=${CI_REPOSITORY_NAME}" >> $GITHUB_ENV
echo "${{github.workspace}}"
- name: Setup .NET
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: '5.0.x'
- name: Restore dependencies
run: dotnet restore ./master
- name: Build
run: |
dotnet build ./master --no-restore
- name: Test
run: dotnet test ./master --no-build --verbosity normal
- name: publish
run: dotnet publish ./master -c release
- name: Nav
run: |
ls
#cd bin/release/net5.0/publish/wwwroot
- name: Rewrite base href index.html
uses: SteveSandersonMS/ghaction-rewrite-base-href@v1
with:
html_path: ${{ env.PUBLISH_DIR }}/index.html
base_href: /${{ env.CI_REPOSITORY_NAME }}/
#- name: Rewrite base href 404.html
# uses: SteveSandersonMS/ghaction-rewrite-base-href@v1
# with:
# html_path: ${{ env.PUBLISH_DIR }}/404.html
# base_href: /${{ env.CI_REPOSITORY_NAME }}/
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: RadiocomDataViewApp
path: ${{ env.PUBLISH_DIR }}/
if-no-files-found: error
- name: Copy publish to gh-pages
run: |
ls ./gh-pages
cp -a ${{env.PUBLISH_DIR}}/. ./gh-pages/
cd ./gh-pages
git config user.name actions
git config user.email actions@actions.com
git add .
git commit -m "Updating with latest"
git push origin gh-pages