Skip to content

Commit 23aad3f

Browse files
authored
Update static.yml
updated workflow based on MSFT how to
1 parent 97eed73 commit 23aad3f

File tree

1 file changed

+25
-28
lines changed

1 file changed

+25
-28
lines changed

.github/workflows/static.yml

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
# Simple workflow for deploying static content to GitHub Pages
2-
name: Deploy static content to Pages
3-
1+
# Your GitHub workflow file under .github/workflows/
2+
# Trigger the action on push to main
43
on:
5-
# Runs on pushes targeting the default branch
64
push:
7-
branches: ["main"]
8-
9-
# Allows you to run this workflow manually from the Actions tab
10-
workflow_dispatch:
5+
branches:
6+
- main
117

128
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
139
permissions:
14-
contents: read
10+
actions: read
1511
pages: write
1612
id-token: write
1713

@@ -20,28 +16,29 @@ permissions:
2016
concurrency:
2117
group: "pages"
2218
cancel-in-progress: false
23-
19+
2420
jobs:
25-
# Single deploy job since we're just deploying
26-
deploy:
21+
publish-docs:
2722
environment:
2823
name: github-pages
2924
url: ${{ steps.deployment.outputs.page_url }}
3025
runs-on: ubuntu-latest
3126
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v4
34-
- name: docfx-action
35-
uses: nikeee/docfx-action@v1.0.0
36-
with:
37-
path: '../docs/docfx.json'
38-
- name: Setup Pages
39-
uses: actions/configure-pages@v4
40-
- name: Upload artifact
41-
uses: actions/upload-pages-artifact@v3
42-
with:
43-
# Upload entire repository
44-
path: '../docs/_site'
45-
- name: Deploy to GitHub Pages
46-
id: deployment
47-
uses: actions/deploy-pages@v4
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
- name: Dotnet Setup
30+
uses: actions/setup-dotnet@v3
31+
with:
32+
dotnet-version: 8.x
33+
34+
- run: dotnet tool update -g docfx
35+
- run: docfx /docs/docfx.json
36+
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v3
39+
with:
40+
# Upload entire repository
41+
path: '/docs/_site'
42+
- name: Deploy to GitHub Pages
43+
id: deployment
44+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)