Skip to content

Commit

Permalink
Implement docfx for Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
BattlefieldDuck committed Jan 20, 2024
1 parent bceb9b7 commit dc9e77d
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/docfx-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Workflow for deploying docfx to GitHub Pages
name: Deploy docfx to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# The workflow will only run when there are changes in the 'docs' or 'OpenGSQ' folders
paths:
- 'docs/**'
- 'OpenGSQ/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Dotnet Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x

- run: dotnet tool update -g docfx
- run: docfx docs/docfx.json

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: "docs/_site"

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Docfx
.cache
/_site/
/api/
45 changes: 45 additions & 0 deletions docs/docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"metadata": [
{
"src": [
{
"src": "../OpenGSQ",
"files": [
"**/*.csproj"
]
}
],
"dest": "api"
}
],
"build": {
"content": [
{
"files": [
"**/*.{md,yml}"
],
"exclude": [
"_site/**"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"output": "_site",
"template": [
"default",
"modern"
],
"globalMetadata": {
"_appName": "OpenGSQ",
"_appTitle": "OpenGSQ",
"_enableSearch": true,
"pdf": true
}
}
}
1 change: 1 addition & 0 deletions docs/docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Getting Started
1 change: 1 addition & 0 deletions docs/docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Introduction
4 changes: 4 additions & 0 deletions docs/docs/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Introduction
href: introduction.md
- name: Getting Started
href: getting-started.md
11 changes: 11 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
_layout: landing
---

# This is the **HOMEPAGE**.

Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.

## Quick Start Notes:

1. Add images to the *images* folder if the file is referencing an image.
4 changes: 4 additions & 0 deletions docs/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Docs
href: docs/
- name: API
href: api/

0 comments on commit dc9e77d

Please sign in to comment.