Skip to content
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
56 changes: 56 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Docs

on:
push:
branches:
- main
paths:
- ".github/workflows/docs.yaml"
- "hugo.toml"
- "content/**"
- "layouts/**"
- "static/**"
- "README.md"
- "CONTRIBUTING.md"
- "docs/RELEASE.md"
pull_request:
branches:
- main
paths:
- ".github/workflows/docs.yaml"
- "hugo.toml"
- "content/**"
- "layouts/**"
- "static/**"
- "README.md"
- "CONTRIBUTING.md"
- "docs/RELEASE.md"
workflow_dispatch:

permissions:
contents: write

jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0

- name: Set up Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.148.2'

- name: Build documentation site
run: hugo build --gc --minify

- name: Deploy documentation site
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: public
clean: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
/.idea/
/vendor/
/dist/
/public/
/resources/
/.hugo_build.lock
3 changes: 3 additions & 0 deletions content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: "KVS"
---
3 changes: 3 additions & 0 deletions content/docs/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: "Documentation"
---
34 changes: 34 additions & 0 deletions content/docs/cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: "CLI Usage"
weight: 2
---

The `kvs` binary exposes a small Cobra-based CLI for interacting with the key-value store.

## Basic Commands

```sh
$ kvs --help
$ kvs -v
$ kvs version
```

## Configuration

Use `--config` to load a specific Viper-compatible configuration file:

```sh
$ kvs --config config.yaml version
```

## Available Flags

| Flag | Description |
|------|-------------|
| `--help`, `-h` | Show help for any command |
| `-v` | Show version information |
| `--config` | Path to config file |

## Further Reading

For Go API usage, see the [Overview](../overview/) documentation or the [Go package reference](https://pkg.go.dev/github.com/skyoo2003/kvs).
24 changes: 24 additions & 0 deletions content/docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: "Contributing"
weight: 3
---

Contribution guidance is still being documented.

## Current Status

The repository currently keeps its contribution guide in `CONTRIBUTING.md`, which is marked as `_TBD_`.

## Repository Links

- [Repository on GitHub](https://github.com/skyoo2003/kvs)
- [Project README](https://github.com/skyoo2003/kvs/blob/main/README.md)
- [Current contributing file](https://github.com/skyoo2003/kvs/blob/main/CONTRIBUTING.md)

## Contributing Today

Until the dedicated guide is expanded, use the existing repository files and open a pull request with the proposed change.

## Note

This page summarizes the current contribution information available in the repository.
49 changes: 49 additions & 0 deletions content/docs/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: "Overview"
weight: 1
---

KVS is a simple key-value store written in Go. It provides an in-memory store that can be used as a library within Go programs or via its command-line interface.

## Features

- In-memory key-value storage
- Clean Go API for programmatic use
- Cobra-based CLI for command-line operations
- Viper configuration support

## Installation

Clone and install the CLI:

```sh
$ git clone https://github.com/skyoo2003/kvs.git
$ cd kvs
$ go install ./cmd/kvs
```

## Library Usage

Import `github.com/skyoo2003/kvs` to use KVS as a library:

```go
package main

import (
"fmt"

"github.com/skyoo2003/kvs"
)

func main() {
store := kvs.NewStore()
_ = store.Put("language", "go")

value, _ := store.Get("language")
fmt.Println(value)
}
```

## License

MIT License. See [LICENSE](https://github.com/skyoo2003/kvs/blob/main/LICENSE) for details.
38 changes: 38 additions & 0 deletions content/docs/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: "Release Process"
weight: 4
---

The repository tracks release notes in `docs/RELEASE.md`, automates tagged releases with GitHub Actions, and publishes the documentation site through `gh-pages`.

## Commands

```sh
$ changie new
$ changie batch {version}
$ changie merge
```

## Current Workflow

The release workflow lives in `.github/workflows/release.yaml` and runs when a tag matching `v*` is pushed.

## Project Release

For an application release, prepare the changelog with `changie`, push a version tag such as `v1.2.3`, and let the `Release` workflow publish the artifacts defined in `.goreleaser.yml`.

After the tag is pushed, verify that the `Release` workflow succeeds and that the GitHub release contains the expected binaries and archives.

## Documentation Site Release

The documentation workflow lives in `.github/workflows/docs.yaml`.

When a docs-related change is pushed to `main`, GitHub Actions builds the Hugo site and deploys the generated `public/` directory to the `gh-pages` branch.

For this to publish correctly, repository settings must point GitHub Pages at the `gh-pages` branch root.

After a merge, verify that the `Docs` workflow succeeds and that the site is available at `https://skyoo2003.github.io/kvs/`.

## Note

This page summarizes the current release information and workflow already present in the repository.
58 changes: 57 additions & 1 deletion docs/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Release

_TBD_
This repository has two release paths:

- tagged application releases through `.github/workflows/release.yaml`
- static documentation site releases through `.github/workflows/docs.yaml`

## Commands

Expand All @@ -9,3 +12,56 @@ $ changie new
$ changie batch {version}
$ changie merge
```

## Project Release

Project releases are published from `.github/workflows/release.yaml` when a tag matching `v*` is pushed.

### Preparation

1. Create changelog entries with `changie new`
2. Batch the release notes with `changie batch {version}`
3. Merge the changelog with `changie merge`
4. Commit the release notes and create the release tag

### Publish Flow

1. Push a tag such as `v1.2.3`
2. GitHub Actions runs `.github/workflows/release.yaml`
3. GoReleaser builds the `kvs` binaries and archives defined in `.goreleaser.yml`
4. The workflow publishes the GitHub release artifacts and related package outputs

### Verification

After pushing the tag, confirm that the `Release` workflow succeeds and that the expected release artifacts are attached to the GitHub release.

## Documentation Site Release

The static documentation site is built with Hugo and published to the `gh-pages` branch.

### Trigger

The docs workflow runs on pushes to `main` when one of these paths changes:

- `hugo.toml`
- `content/**`
- `layouts/**`
- `static/**`
- `README.md`
- `CONTRIBUTING.md`
- `docs/RELEASE.md`
- `.github/workflows/docs.yaml`

### Publish Flow

1. GitHub Actions runs `.github/workflows/docs.yaml`
2. Hugo builds the site into `public/`
3. `JamesIves/github-pages-deploy-action` publishes `public/` to the `gh-pages` branch

### Repository Setting

GitHub Pages must be configured to serve from the `gh-pages` branch root.

### Verification

After merging a docs change to `main`, confirm that the `Docs` workflow succeeds and that the site is available at `https://skyoo2003.github.io/kvs/`
16 changes: 16 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
baseURL = 'https://skyoo2003.github.io/kvs/'
languageCode = 'en-us'
title = 'KVS Documentation'

[menu]
[[menu.main]]
name = "Home"
url = "/"
weight = 1
[[menu.main]]
name = "Documentation"
url = "/docs/"
weight = 2

[markup.goldmark.renderer]
unsafe = true
25 changes: 25 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ if .Title }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>
<link rel="stylesheet" href="{{ "css/style.css" | relURL }}">
</head>
<body>
<header>
<nav>
<a href="{{ .Site.Home.RelPermalink }}" class="logo">KVS</a>
{{ range .Site.Menus.main }}
<a href="{{ .URL | relURL }}" {{ if eq $.RelPermalink .URL }}class="active"{{ end }}>{{ .Name }}</a>
{{ end }}
</nav>
</header>
<main>
{{ block "main" . }}{{ end }}
</main>
<footer>
<p>&copy; 2020-2021 Sung-Kyu Yoo &middot; MIT License</p>
</footer>
</body>
</html>
10 changes: 10 additions & 0 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{ define "main" }}
<section class="doc-list">
<h1>{{ .Title }}</h1>
<ul>
{{ range .Pages }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
</section>
{{ end }}
6 changes: 6 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ define "main" }}
<article class="doc">
<h1>{{ .Title }}</h1>
{{ .Content }}
</article>
{{ end }}
18 changes: 18 additions & 0 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{ define "main" }}
<section class="hero">
<h1>KVS</h1>
<p class="tagline">A simple key-value store for Go</p>
</section>
<section class="intro">
<p>KVS is a lightweight in-memory key-value store with a Cobra-based CLI. Import it into your Go programs or use the command-line tool directly.</p>
</section>
<section class="quick-links">
<h2>Documentation</h2>
<ul>
<li><a href="{{ "docs/overview/" | relURL }}">Overview</a> &mdash; Project introduction and features</li>
<li><a href="{{ "docs/cli/" | relURL }}">CLI Usage</a> &mdash; Command-line interface guide</li>
<li><a href="{{ "docs/contributing/" | relURL }}">Contributing</a> &mdash; How to contribute</li>
<li><a href="{{ "docs/release/" | relURL }}">Release</a> &mdash; Release process information</li>
</ul>
</section>
{{ end }}
Loading
Loading