-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (45 loc) · 1.68 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
50
51
52
53
54
55
56
name: Deploy to GitHub Page
# Controls when the action will run
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.x.x'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '5.x'
- name: Execute GitVersion
uses: gittools/actions/gitversion/execute@v0.9.7
with:
additionalArguments: '/updateprojectfiles /showconfig'
- name: Test application
run: dotnet test tests/NameBadgeAutomater.Tests/NameBadgeAutomater.Tests.csproj -c Release
# base href url value should be changed so that resources like CSS and scripts can load properly.
- name: Rewrite base href
if: success()
uses: SteveSandersonMS/ghaction-rewrite-base-href@v1
with:
html_path: src/NameBadgeAutomater/wwwroot/index.html
base_href: /name-badge-automater/
- name: Publish application
run: dotnet publish src/NameBadgeAutomater/NameBadgeAutomater.csproj -c Release
# 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 src/NameBadgeAutomater/bin/Release/net7.0/publish/wwwroot/.nojekyll
- name: Commit to GitHub pages Repo
if: success()
uses: crazy-max/ghaction-github-pages@v1.5.1
with:
target_branch: gh-pages
build_dir: src/NameBadgeAutomater/bin/Release/net7.0/publish/wwwroot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}