Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Pages Part 2 - Add Hugo rendering and deployment #92

Merged
merged 4 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/deploy-github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Deploy Hugo site to Pages

on:
push:
branches: ["main"]
paths:
- 'docs/**'
workflow_dispatch:

permissions: {}

concurrency:
group: "pages"
cancel-in-progress: false

defaults:
run:
shell: bash

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
env:
HUGO_VERSION: 0.124.1
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
submodules: recursive
- name: Setup Pages
id: pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- name: Install Node.js dependencies
working-directory: ./docs
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
working-directory: ./docs
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: ./docs/public

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public/**
Empty file added docs/.hugo_build.lock
Empty file.
5 changes: 5 additions & 0 deletions docs/archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
date = {{ .Date }}
draft = true
+++
5 changes: 5 additions & 0 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: "poutine"
---

This is the documentation for the [poutine](https://github.com/boostsecurityio/poutine) project.
1 change: 1 addition & 0 deletions docs/content/en/rules/debug_enabled.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@ job_name:
```

## See Also
- https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging
- https://docs.gitlab.com/ee/ci/variables/index.html#enable-debug-logging
- https://docs.gitlab.com/ee/ci/variables/index.html#mask-a-cicd-variable
6 changes: 6 additions & 0 deletions docs/data/menu/extra.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
header:
- name: GitHub
ref: https://github.com/boostsecurityio/poutine
icon: gdoc_github
external: true
11 changes: 11 additions & 0 deletions docs/data/menu/more.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
more:
- name: Releases
ref: "https://github.com/boostsecurityio/poutine/releases"
external: true
icon: "gdoc_download"
- name: GitHub
ref: "https://github.com/boostsecurityio/poutine"
external: true
icon: "gdoc_github"

30 changes: 30 additions & 0 deletions docs/hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
baseURL = 'https://boostsecurityio.github.io/poutine/'
languageCode = 'en-us'
title = 'poutine'
theme = "hugo-geekdoc"

pluralizeListTitles = false

# Geekdoc required configuration
#pygmentsUseClasses = true
pygmentsUseClasses = false
pygmentsCodeFences = true
disablePathToLower = true
# geekdocFileTreeSortBy = "linkTitle"

# Required if you want to render robots.txt template
enableRobotsTXT = true

# Needed for mermaid shortcodes
[markup]
[markup.goldmark.renderer]
# Needed for mermaid shortcode
unsafe = true
[markup.tableOfContents]
startLevel = 1
endLevel = 9
[markup.highlight]
style = 'solarized-dark'

[taxonomies]
tag = "tags"
Loading