Skip to content

Commit 9e8a7be

Browse files
committed
Add installation instructions
1 parent 5c940d3 commit 9e8a7be

File tree

3 files changed

+56
-6
lines changed

3 files changed

+56
-6
lines changed

.github/workflows/github-pages.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
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-
41
name: GitHub Pages
52

63
on:
@@ -18,12 +15,13 @@ jobs:
1815
env:
1916
DOCS_DIR: 'docs/'
2017
DEST_DIR: '_site/'
18+
BRANCH: 'main'
2119
steps:
2220
- uses: actions/configure-pages@v5
2321
id: configure-pages
2422
- uses: actions/checkout@v3
2523
with:
26-
ref: 'main'
24+
ref: ${{ env.BRANCH }}
2725
fetch-depth: 0 # checkout a non-shallow copy so the generator can generate docs for all major versions
2826
- uses: ./
2927
with:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# gopxl documentation site generator
22

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)
Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,55 @@
11
# Installation
22

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`.

0 commit comments

Comments
 (0)