Skip to content

Commit

Permalink
Add installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkKremer committed Aug 27, 2024
1 parent 5c940d3 commit 9e8a7be
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 6 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: GitHub Pages

on:
Expand All @@ -18,12 +15,13 @@ jobs:
env:
DOCS_DIR: 'docs/'
DEST_DIR: '_site/'
BRANCH: 'main'
steps:
- uses: actions/configure-pages@v5
id: configure-pages
- uses: actions/checkout@v3
with:
ref: 'main'
ref: ${{ env.BRANCH }}
fetch-depth: 0 # checkout a non-shallow copy so the generator can generate docs for all major versions
- uses: ./
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# gopxl documentation site generator

[Go to the documentation](https://markkremer.github.io/gopxl-docs-generator/main/01.%20Getting%20Started/01.%20Installation.html)
[Go to the documentation](https://gopxl.github.io/docs/main/01.%20Getting%20Started/01.%20Installation.html)
54 changes: 53 additions & 1 deletion docs/01. Getting Started/01. Installation.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
# Installation

todo
## Enable GitHub Pages

In your repository on GitHub, go to Settings → Pages.
Under Build and deployment → Source, change the option to `GitHub Actions`.

## Create a GitHub Workflow

In your project, create a GitHub Workflow file:
```yaml
# .github/workflows/github-pages.yml
name: GitHub Pages

on:
push:
branches: ['main']
tags: ['*']

jobs:

upload-docs:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
env:
DOCS_DIR: 'docs/'
DEST_DIR: '_site/'
BRANCH: 'main'
steps:
- uses: actions/configure-pages@v5
id: configure-pages
- uses: actions/checkout@v3
with:
ref: ${{ env.BRANCH }}
fetch-depth: 0 # checkout a non-shallow copy so the generator can generate docs for all major versions
- uses: gopxl/docs@main
with:
deploy-url: ${{ steps.configure-pages.outputs.base_url }}
docs-directory: ${{ env.DOCS_DIR }}
destination-directory: ${{ env.DEST_DIR }}
- uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.DEST_DIR }}
- uses: actions/deploy-pages@v4
```
The `DOCS_DIR` environment variable can be changed to point
to the directory containing the MarkDown files.

## View your website

If your GitHub repository is hosted at `https://github.com/owner/project`,
your GitHub Pages site will be available at `https://owner.github.io/project`.

0 comments on commit 9e8a7be

Please sign in to comment.