File tree Expand file tree Collapse file tree 3 files changed +56
-6
lines changed Expand file tree Collapse file tree 3 files changed +56
-6
lines changed Original file line number Diff line number Diff line change 1
- # This workflow will build a golang project
2
- # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3
-
4
1
name : GitHub Pages
5
2
6
3
on :
@@ -18,12 +15,13 @@ jobs:
18
15
env :
19
16
DOCS_DIR : ' docs/'
20
17
DEST_DIR : ' _site/'
18
+ BRANCH : ' main'
21
19
steps :
22
20
- uses : actions/configure-pages@v5
23
21
id : configure-pages
24
22
- uses : actions/checkout@v3
25
23
with :
26
- ref : ' main '
24
+ ref : ${{ env.BRANCH }}
27
25
fetch-depth : 0 # checkout a non-shallow copy so the generator can generate docs for all major versions
28
26
- uses : ./
29
27
with :
Original file line number Diff line number Diff line change 1
1
# gopxl documentation site generator
2
2
3
- [ Go to the documentation] ( https://markkremer .github.io/gopxl- docs-generator /main/01.%20Getting%20Started/01.%20Installation.html )
3
+ [ Go to the documentation] ( https://gopxl .github.io/docs/main/01.%20Getting%20Started/01.%20Installation.html )
Original file line number Diff line number Diff line change 1
1
# Installation
2
2
3
- todo
3
+ ## Enable GitHub Pages
4
+
5
+ In your repository on GitHub, go to Settings → Pages.
6
+ Under Build and deployment → Source, change the option to ` GitHub Actions ` .
7
+
8
+ ## Create a GitHub Workflow
9
+
10
+ In your project, create a GitHub Workflow file:
11
+ ``` yaml
12
+ # .github/workflows/github-pages.yml
13
+ name : GitHub Pages
14
+
15
+ on :
16
+ push :
17
+ branches : ['main']
18
+ tags : ['*']
19
+
20
+ jobs :
21
+
22
+ upload-docs :
23
+ runs-on : ubuntu-latest
24
+ permissions :
25
+ pages : write
26
+ id-token : write
27
+ env :
28
+ DOCS_DIR : ' docs/'
29
+ DEST_DIR : ' _site/'
30
+ BRANCH : ' main'
31
+ steps :
32
+ - uses : actions/configure-pages@v5
33
+ id : configure-pages
34
+ - uses : actions/checkout@v3
35
+ with :
36
+ ref : ${{ env.BRANCH }}
37
+ fetch-depth : 0 # checkout a non-shallow copy so the generator can generate docs for all major versions
38
+ - uses : gopxl/docs@main
39
+ with :
40
+ deploy-url : ${{ steps.configure-pages.outputs.base_url }}
41
+ docs-directory : ${{ env.DOCS_DIR }}
42
+ destination-directory : ${{ env.DEST_DIR }}
43
+ - uses : actions/upload-pages-artifact@v3
44
+ with :
45
+ path : ${{ env.DEST_DIR }}
46
+ - uses : actions/deploy-pages@v4
47
+ ` ` `
48
+
49
+ The ` DOCS_DIR` environment variable can be changed to point
50
+ to the directory containing the MarkDown files.
51
+
52
+ # # View your website
53
+
54
+ If your GitHub repository is hosted at `https://github.com/owner/project`,
55
+ your GitHub Pages site will be available at `https://owner.github.io/project`.
You can’t perform that action at this time.
0 commit comments