feat: docs website

This commit is contained in:
Julian Tölle 2025-05-04 01:58:10 +02:00
parent c175ca0352
commit ade57cf040
15 changed files with 118 additions and 3 deletions

View file

@ -0,0 +1,16 @@
name: "Setup mdbook"
inputs:
version:
description: "mdbook version"
runs:
using: composite
steps:
- name: Setup mdbook
shell: bash
env:
url: https://github.com/rust-lang/mdbook/releases/download/${{ inputs.version }}/mdbook-${{ inputs.version }}-x86_64-unknown-linux-gnu.tar.gz
run: |
mkdir mdbook
curl -sSL "$url" | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH

39
.github/workflows/docs.yaml vendored Normal file
View file

@ -0,0 +1,39 @@
name: docs
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pages: write # To push to a GitHub Pages site
id-token: write # To update the deployment status
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
lfs: "true"
- uses: ./.github/actions/setup-mdbook
with:
version: v0.4.42 # renovate: datasource=github-releases depName=rust-lang/mdbook
- name: Build Book
working-directory: docs
run: mdbook build
- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
- name: Upload artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
# Upload entire repository
path: "docs/book"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4

View file

@ -1,6 +1,15 @@
# `hcloud-upload-image` # `hcloud-upload-image`
Quickly upload any raw disk images into your [Hetzner Cloud](https://hetzner.com/cloud) projects! <p align="center">
Quickly upload any raw disk images into your <a href="https://hetzner.com/cloud" target="_blank">Hetzner Cloud</a> projects!
</p>
<p align="center">
<a href="https://apricote.github.io/hcloud-upload-image" target="_blank"><img src="https://img.shields.io/badge/Documentation-brightgreen?style=flat-square" alt="Badge: Documentation"/></a>
<a href="https://github.com/apricote/hcloud-upload-image/releases" target="_blank"><img src="https://img.shields.io/github/v/release/apricote/hcloud-upload-image?sort=semver&display_name=release&style=flat-square&color=green" alt="Badge: Stable Release"/></a>
<img src="https://img.shields.io/badge/License-MIT-green?style=flat-square" alt="Badge: License MIT"/>
</p>
## About ## About
@ -63,7 +72,7 @@ hcloud-upload-image upload \
--compression bz2 --compression bz2
``` ```
To learn more, you can use the embedded help output or check out the [CLI help pages in this repository](docs/cli/hcloud-upload-image.md).: To learn more, you can use the embedded help output or check out the [CLI help pages in this repository](docs/reference/cli/hcloud-upload-image.md).:
```shell ```shell
hcloud-upload-image --help hcloud-upload-image --help

2
docs/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
book
https:

22
docs/SUMMARY.md Normal file
View file

@ -0,0 +1,22 @@
# Summary
[Introduction](introduction.md)
# Guides
- [Uploading Images](guides/README.md)
- [Fedora CoreOS ↗](https://docs.fedoraproject.org/en-US/fedora-coreos/provisioning-hetzner/#_creating_a_snapshot)
- [Flatcar Container Linux ↗](https://www.flatcar.org/docs/latest/installing/cloud/hetzner/#building-the-snapshots-1)
- [Talos Linux ↗](https://www.talos.dev/v1.10/talos-guides/install/cloud-platforms/hetzner/#hcloud-upload-image)
# Reference
- [CLI](reference/cli/hcloud-upload-image.md)
- [`upload`](reference/cli/hcloud-upload-image_upload.md)
- [`cleanup`](reference/cli/hcloud-upload-image_cleanup.md)
- [Go Library](reference/go-library.md)
---
[Changelog CLI](changelog.md)
[Changelog Go Library](changelog-hcloudimages.md)

8
docs/book.toml Normal file
View file

@ -0,0 +1,8 @@
[book]
language = "en"
multilingual = false
src = "."
title = "hcloud-upload-image"
[output.html]
git-repository-url = "https://github.com/apricote/hcloud-upload-image"

View file

@ -0,0 +1,3 @@
# Changelog Library
{{#include ../hcloudimages/CHANGELOG.md:2: }}

3
docs/changelog.md Normal file
View file

@ -0,0 +1,3 @@
# Changelog CLI
{{#include ../CHANGELOG.md:2: }}

7
docs/guides/README.md Normal file
View file

@ -0,0 +1,7 @@
# Uploading Images
Check out these docs from other projects to learn how to use `hcloud-upload-image`:
- [Fedora CoreOS ↗](https://docs.fedoraproject.org/en-US/fedora-coreos/provisioning-hetzner/#_creating_a_snapshot)
- [Flatcar Container Linux ↗](https://www.flatcar.org/docs/latest/installing/cloud/hetzner/#building-the-snapshots-1)
- [Talos Linux ↗](https://www.talos.dev/v1.10/talos-guides/install/cloud-platforms/hetzner/#hcloud-upload-image)

3
docs/introduction.md Normal file
View file

@ -0,0 +1,3 @@
# Introduction
{{#include ../README.md:2:}}

View file

@ -0,0 +1,3 @@
# Go Library
You can find the documentation at [pkg.go.dev/github.com/apricote/hcloud-upload-image/hcloudimages ↗](https://pkg.go.dev/github.com/apricote/hcloud-upload-image/hcloudimages).

View file

@ -11,7 +11,7 @@ import (
func run() error { func run() error {
// Define the directory where the docs will be generated // Define the directory where the docs will be generated
dir := "docs/cli" dir := "docs/reference/cli"
// Ensure the directory exists // Ensure the directory exists
if err := os.MkdirAll(dir, 0755); err != nil { if err := os.MkdirAll(dir, 0755); err != nil {