Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Overhaul hugo #64

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
7 changes: 3 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/devcontainers/features/hugo:1": { "extended": true },
"ghcr.io/devcontainers/features/node:1": {}
}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand All @@ -17,11 +16,11 @@
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
"postCreateCommand": "npm ci; npm i -g add-local-binaries-to-path",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
"remoteUser": "vscode"
}
32 changes: 22 additions & 10 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Deploy Hugo site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
branches: [$default-branch]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -30,20 +30,21 @@ jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.112.3
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 Embedded
run: sudo snap install dart-sass-embedded
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Get HUGO_VERSION from package.json
run: echo "HUGO_VERSION=$(npm pkg get dependencies.hugo-extended 2>/dev/null | tr -d \"\^)" >> "$GITHUB_ENV"
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${HUGO_VERSION}
extended: true
- name: Install Dart Sass Embedded
run: sudo snap install dart-sass
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
Expand All @@ -58,6 +59,17 @@ jobs:
hugo \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"

# check if there are broken html links and fail before upload
validate:
runs-on: ubuntu-latest
needs: build
steps:
- name: Link Checker
uses: lycheeverse/lychee-action@v1
with:
fail: true
args: "--verbose --no-progress './public/**/*.md' './public/**/*.html' './public/**/*.rst'"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
Expand All @@ -69,7 +81,7 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
needs: validate
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2023 plusserver GmbH

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Loading