-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 1.92 KB
/
github-pages.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
name: Deploy to GitHub Pages
env:
PUBLISH_DIR: bin/Release/net7.0/publish/
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Build job
build:
runs-on: ubuntu-latest
permissions:
actions: write
checks: write
contents: write
deployments: write
id-token: write
issues: write
packages: write
pages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Publish app
run: dotnet publish -c Release --output ${{ env.PUBLISH_DIR }}
- name: Rewrite base href
uses: SteveSandersonMS/ghaction-rewrite-base-href@v1
with:
html_path: ${{ env.PUBLISH_DIR }}wwwroot/index.html
base_href: /${{ github.event.repository.name }}/
- name: Commit to GitHub pages Repo
if: success()
uses: crazy-max/[email protected]
with:
target_branch: gh-pages
build_dir: ${{ env.PUBLISH_DIR }}wwwroot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Artifact GitHub Action
#uses: actions/upload-artifact@v2
uses: actions/upload-pages-artifact@v1
with:
name: github-pages
path: ${{ env.PUBLISH_DIR }}wwwroot
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
permissions:
id-token: write
pages: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1