Skip to content

Commit 137f049

Browse files
authored
Merge pull request #188 from MoiraeSoftware/copilot/fix-e70b52c5-8348-4030-a971-6b49f28ae1d8
Add GitHub Pages deployment for Hugo documentation site with theme fix
2 parents 8ed345d + c1782bb commit 137f049

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

.github/workflows/docs.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Deploy Documentation to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/docs.yml'
9+
pull_request:
10+
branches: [ master ]
11+
paths:
12+
- 'docs/**'
13+
- '.github/workflows/docs.yml'
14+
15+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+
concurrency:
24+
group: "pages"
25+
cancel-in-progress: false
26+
27+
jobs:
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
submodules: recursive
35+
fetch-depth: 0
36+
37+
- name: Setup Hugo
38+
uses: peaceiris/actions-hugo@v2
39+
with:
40+
hugo-version: '0.128.2'
41+
extended: true
42+
43+
- name: Setup Pages
44+
id: pages
45+
uses: actions/configure-pages@v4
46+
if: github.ref == 'refs/heads/master'
47+
48+
- name: Build with Hugo
49+
run: |
50+
cd docs
51+
hugo \
52+
--minify \
53+
--baseURL "${{ steps.pages.outputs.base_url }}/"
54+
env:
55+
HUGO_ENVIRONMENT: production
56+
HUGO_ENV: production
57+
58+
- name: Upload artifact
59+
uses: actions/upload-pages-artifact@v3
60+
if: github.ref == 'refs/heads/master'
61+
with:
62+
path: ./docs/public
63+
64+
deploy:
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
runs-on: ubuntu-latest
69+
needs: build
70+
if: github.ref == 'refs/heads/master'
71+
steps:
72+
- name: Deploy to GitHub Pages
73+
id: deployment
74+
uses: actions/deploy-pages@v4

Contributing.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
2. Run `dotnet tool restore` to install required local tools
44
3. Run `dotnet build -c Release -t:Build`
55

6+
# How to build documentation:
7+
The documentation is built using Hugo and automatically deployed to GitHub Pages on every push to the master branch.
8+
9+
To build the documentation locally:
10+
1. Install [Hugo](https://gohugo.io/getting-started/installing/) (version 0.126.3 or later)
11+
2. Navigate to the `docs` directory: `cd docs`
12+
3. Initialize the theme submodule: `git submodule update --init --recursive`
13+
4. Build the site: `hugo --minify`
14+
5. The generated site will be in the `docs/public` directory
15+
6. To preview locally: `hugo server` (available at http://localhost:1313/myriad/)
16+
17+
The documentation is automatically published to https://moiraesoftware.github.io/myriad/ via GitHub Actions.
18+
619
# How to debug:
720
- uncomment line `<!-- <MyriadSdkWaitForDebugger>true</MyriadSdkWaitForDebugger> -->` in test\Myriad.IntegrationPluginTests\Myriad.IntegrationPluginTests.fsproj
821
- `dotnet build test\Myriad.IntegrationPluginTests -v n` the test project

0 commit comments

Comments
 (0)