aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2024-04-27 21:21:51 +0200
committerGravatar Joe Banks <[email protected]>2024-04-27 21:21:04 +0100
commitde9307796340070c0b44e6325a902184ad65492a (patch)
treef7a873d1a4b14281580b0450ba77ee9290b22c3c /.github/workflows
parentUse same indent for all fail2ban options (diff)
Move documentation to Hugo
Shortly before merge, the repository settings need to be updated to set GitHub Actions as the deployment source, to prevent GitHub from trying to build with Jekyll.
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/docs.yaml72
-rw-r--r--.github/workflows/lint-docs.yaml17
2 files changed, 89 insertions, 0 deletions
diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml
new file mode 100644
index 0000000..b5e3c03
--- /dev/null
+++ b/.github/workflows/docs.yaml
@@ -0,0 +1,72 @@
+# Sample workflow for building and deploying a Hugo site to GitHub Pages
+name: Deploy Hugo site to Pages
+
+on:
+ # Runs on pushes targeting the default branch
+ push:
+ branches:
+ - main
+
+ # 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
+
+# Default to bash
+defaults:
+ run:
+ shell: bash
+
+jobs:
+ # Build job
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Install Hugo CLI
+ run: |
+ apt-get update -y && apt-get install -y hugo
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ fetch-depth: 0
+ - name: Setup Pages
+ id: pages
+ uses: actions/configure-pages@v4
+ - name: Build with Hugo
+ env:
+ # For maximum backward compatibility with Hugo modules
+ HUGO_ENVIRONMENT: production
+ HUGO_ENV: production
+ TZ: UTC
+ run: |
+ cd docs && hugo \
+ --gc \
+ --minify \
+ --baseURL "${{ steps.pages.outputs.base_url }}/"
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v3
+ with:
+ path: ./docs/public
+
+ # Deployment job
+ deploy:
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ runs-on: ubuntu-latest
+ needs: build
+ steps:
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v4
diff --git a/.github/workflows/lint-docs.yaml b/.github/workflows/lint-docs.yaml
new file mode 100644
index 0000000..cc7be0a
--- /dev/null
+++ b/.github/workflows/lint-docs.yaml
@@ -0,0 +1,17 @@
+name: Test documentation
+on:
+ pull_request:
+
+jobs:
+ lint-docs:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Install hugo
+ run: |
+ sudo apt-get update -y
+ sudo apt-get install -y hugo
+ - name: Run hugo
+ run: |
+ cd docs
+ hugo --panicOnWarning --renderToMemory