Initial commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
FROM ghcr.io/gohugoio/hugo:latest
|
||||||
|
|
||||||
|
USER root
|
||||||
|
# The image's "hugo" user is a system account (adduser -S) with shell /sbin/nologin,
|
||||||
|
# since it's only meant to run the hugo binary. VS Code's integrated terminal needs
|
||||||
|
# an interactive shell, so give it one.
|
||||||
|
RUN apk add --no-cache git-lfs && \
|
||||||
|
sed -i 's#/sbin/nologin#/bin/sh#' /etc/passwd
|
||||||
|
USER hugo:hugo
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainers/features/common-utils:2": {
|
||||||
|
"version": "2.5.9",
|
||||||
|
"resolved": "ghcr.io/devcontainers/features/common-utils@sha256:cb0c4d3c276f157eed17935747e364178d75fee17f55c4e129966f64633deb3a",
|
||||||
|
"integrity": "sha256:cb0c4d3c276f157eed17935747e364178d75fee17f55c4e129966f64633deb3a"
|
||||||
|
},
|
||||||
|
"ghcr.io/devcontainers/features/git-lfs:1": {
|
||||||
|
"version": "1.2.5",
|
||||||
|
"resolved": "ghcr.io/devcontainers/features/git-lfs@sha256:71c2b371cf12ab7fcec47cf17369c6f59156100dad9abf9e4c593049d789de72",
|
||||||
|
"integrity": "sha256:71c2b371cf12ab7fcec47cf17369c6f59156100dad9abf9e4c593049d789de72"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
|
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose
|
||||||
|
{
|
||||||
|
"name": "Förderverein Niere e.V.",
|
||||||
|
"dockerComposeFile": [
|
||||||
|
"../docker-compose.yml",
|
||||||
|
"docker-compose.yml"
|
||||||
|
],
|
||||||
|
"service": "server",
|
||||||
|
"workspaceFolder": "/project",
|
||||||
|
"postCreateCommand": "git lfs install",
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"extensions": [
|
||||||
|
"arr.marksman",
|
||||||
|
"mjmlio.vscode-mjml",
|
||||||
|
"davidanson.vscode-markdownlint",
|
||||||
|
"ecmel.vscode-html-css",
|
||||||
|
"redhat.vscode-yaml",
|
||||||
|
"yzhang.markdown-all-in-one",
|
||||||
|
"jsynowiec.vscode-insertdatestring",
|
||||||
|
"netcorext.uuid-generator",
|
||||||
|
"motivesoft.vscode-uuid-generator",
|
||||||
|
"jsynowiec.vscode-insertdatestring"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
services:
|
||||||
|
# Update this to the name of the service you want to work with in your docker-compose.yml file
|
||||||
|
server:
|
||||||
|
# Build on top of the hugo image so git-lfs can be installed as root at build time
|
||||||
|
# (the base image, and this override, run as the non-root "hugo" user at container
|
||||||
|
# runtime, so postCreateCommand can no longer apk add anything).
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: .devcontainer/Dockerfile
|
||||||
|
|
||||||
|
# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
|
||||||
|
# cap_add:
|
||||||
|
# - SYS_PTRACE
|
||||||
|
# security_opt:
|
||||||
|
# - seccomp:unconfined
|
||||||
|
|
||||||
|
# Overrides default command so things don't shut down after the process ends.
|
||||||
|
# command: sleep infinity
|
||||||
|
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
name: Build and Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
timezone: 'Europe/Berlin'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: self-hosted
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: ghcr.io/gohugoio/hugo:latest
|
||||||
|
options: --user root
|
||||||
|
env:
|
||||||
|
HUGO_ENVIRONMENT: production
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
# with:
|
||||||
|
# submodules: true # Required if your theme is a Git submodule
|
||||||
|
# fetch-depth: 0 # Hugo uses full history for .GitInfo and lastmod
|
||||||
|
|
||||||
|
- name: Install git and git-lfs
|
||||||
|
run: |
|
||||||
|
apk add --no-cache git git-lfs
|
||||||
|
git lfs install
|
||||||
|
|
||||||
|
- name: Pull LFS objects
|
||||||
|
run: git lfs pull
|
||||||
|
|
||||||
|
- name: Install Bootstrap/Sass
|
||||||
|
run: |
|
||||||
|
npm install bootstrap sass
|
||||||
|
mkdir -p themes/bootstrap-theme/assets/scss/bootstrap
|
||||||
|
cp -r node_modules/bootstrap/scss/. themes/bootstrap-theme/assets/scss/bootstrap
|
||||||
|
|
||||||
|
- name: Update modules
|
||||||
|
run: hugo mod get -u
|
||||||
|
|
||||||
|
- name: Build site
|
||||||
|
env:
|
||||||
|
HUGO_GIT_BRANCH: ${{ gitea.ref_name }}
|
||||||
|
run: hugo --minify
|
||||||
|
|
||||||
|
- name: Install rsync and openssh-client
|
||||||
|
run: |
|
||||||
|
apk add --no-cache rsync openssh-client
|
||||||
|
# Hugo's official image is Alpine-based; use apk.
|
||||||
|
# If a Debian-based Hugo image is used, swap to:
|
||||||
|
# apt-get update && apt-get install -y rsync openssh-client
|
||||||
|
|
||||||
|
- name: Set up SSH key
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
echo "${{ secrets.DEPLOY_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
|
||||||
|
chmod 644 ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Deploy via rsync
|
||||||
|
run: |
|
||||||
|
rsync -avz --delete \
|
||||||
|
-e "ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=yes" \
|
||||||
|
public/ \
|
||||||
|
${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:/${{ secrets.DEPLOY_SUBDIR }}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
public/
|
||||||
|
*/_gen/*
|
||||||
|
*template*.html
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# hugo-template
|
||||||
|
|
||||||
|
**Template for websites powered by Hugo.**
|
||||||
|
|
||||||
|
This uses YAML configuration files stored in `config/`.
|
||||||
|
|
||||||
|
Customize the template as follows:
|
||||||
|
|
||||||
|
- Edit `config/_default.hugo.yaml`.
|
||||||
|
- Change the project name in:
|
||||||
|
- `.devcontainer/devcontainer.json`
|
||||||
|
- `docker-compose.yml`
|
||||||
|
- Change the module name in `go.mod` to something else, e.g. the project's public repository URL.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
+++
|
||||||
|
date = '{{ .Date }}'
|
||||||
|
draft = true
|
||||||
|
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
|
||||||
|
+++
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
baseURL: https://example.org/
|
||||||
|
locale: en-us
|
||||||
|
title: My New Hugo Project
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
name: Website powered by Hugo
|
||||||
|
services:
|
||||||
|
build:
|
||||||
|
image: ghcr.io/gohugoio/hugo:latest
|
||||||
|
command: build --minify
|
||||||
|
volumes:
|
||||||
|
- ".:/project"
|
||||||
|
user: 1000:1000
|
||||||
|
environment:
|
||||||
|
HUGO_ENVIRONMENT: production
|
||||||
|
server:
|
||||||
|
image: ghcr.io/gohugoio/hugo:latest
|
||||||
|
command: server --bind 0.0.0.0 -M --buildDrafts --buildFuture
|
||||||
|
volumes:
|
||||||
|
- ".:/project"
|
||||||
|
- "../../../../local/Code/hugo_bootstrap_theme:/hugo_bootstrap_theme"
|
||||||
|
- "../../../../local/Code/hugo_cookie_consent:/hugo_cookie_consent"
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:1313:1313"
|
||||||
|
user: 1000:1000
|
||||||
|
environment:
|
||||||
|
HUGO_ENVIRONMENT: development
|
||||||
|
TZ: Europe/Berlin
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
module website_powered_by_hugo
|
||||||
|
|
||||||
|
go 1.22
|
||||||
|
|
||||||
|
require (
|
||||||
|
git.bovender.de/daniel/hugo_bootstrap_theme v0.0.1 // indirect
|
||||||
|
git.bovender.de/daniel/hugo_cookie_consent v0.0.6 // indirect
|
||||||
|
)
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
go 1.22
|
||||||
|
|
||||||
|
use .
|
||||||
|
use ../hugo_cookie_consent
|
||||||
|
use ../hugo_bootstrap_theme
|
||||||
Reference in New Issue
Block a user