Skip to content

Commit 7989455

Browse files
Merge pull request #68 from pascalinthecloud/67-add-docs-for-setup
feat: add initial documentation structure and configuration files
2 parents 2bcc13a + 9776544 commit 7989455

File tree

16 files changed

+6754
-0
lines changed

16 files changed

+6754
-0
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Sample workflow for building and deploying an Astro site to GitHub Pages
2+
#
3+
# To get started with Astro see: https://docs.astro.build/en/getting-started/
4+
#
5+
name: Deploy Astro site to Pages
6+
7+
on:
8+
# Runs on pushes targeting the default branch
9+
push:
10+
branches: ["main"]
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+
concurrency:
24+
group: "pages"
25+
cancel-in-progress: false
26+
27+
env:
28+
BUILD_PATH: "docs" # default value when not using subfolders
29+
# BUILD_PATH: subfolder
30+
31+
jobs:
32+
build:
33+
name: Build
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
- name: Detect package manager
39+
id: detect-package-manager
40+
run: |
41+
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
42+
echo "manager=yarn" >> $GITHUB_OUTPUT
43+
echo "command=install" >> $GITHUB_OUTPUT
44+
echo "runner=yarn" >> $GITHUB_OUTPUT
45+
echo "lockfile=yarn.lock" >> $GITHUB_OUTPUT
46+
exit 0
47+
elif [ -f "${{ github.workspace }}/package.json" ]; then
48+
echo "manager=npm" >> $GITHUB_OUTPUT
49+
echo "command=ci" >> $GITHUB_OUTPUT
50+
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
51+
echo "lockfile=package-lock.json" >> $GITHUB_OUTPUT
52+
exit 0
53+
else
54+
echo "Unable to determine package manager"
55+
exit 1
56+
fi
57+
- name: Setup Node
58+
uses: actions/setup-node@v4
59+
with:
60+
node-version: "20"
61+
cache: ${{ steps.detect-package-manager.outputs.manager }}
62+
cache-dependency-path: ${{ env.BUILD_PATH }}/${{ steps.detect-package-manager.outputs.lockfile }}
63+
- name: Setup Pages
64+
id: pages
65+
uses: actions/configure-pages@v5
66+
- name: Install dependencies
67+
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
68+
working-directory: ${{ env.BUILD_PATH }}
69+
- name: Build with Astro
70+
run: |
71+
${{ steps.detect-package-manager.outputs.runner }} astro build \
72+
--site "${{ steps.pages.outputs.origin }}" \
73+
--base "${{ steps.pages.outputs.base_path }}"
74+
working-directory: ${{ env.BUILD_PATH }}
75+
- name: Upload artifact
76+
uses: actions/upload-pages-artifact@v3
77+
with:
78+
path: ${{ env.BUILD_PATH }}/dist
79+
80+
deploy:
81+
environment:
82+
name: github-pages
83+
url: ${{ steps.deployment.outputs.page_url }}
84+
needs: build
85+
runs-on: ubuntu-latest
86+
name: Deploy
87+
steps:
88+
- name: Deploy to GitHub Pages
89+
id: deployment
90+
uses: actions/deploy-pages@v4

docs/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store

docs/.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
4+
}

docs/.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

docs/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Starlight Starter Kit: Basics
2+
3+
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
4+
5+
```
6+
npm create astro@latest -- --template starlight
7+
```
8+
9+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
10+
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
11+
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics)
12+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs)
13+
14+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
15+
16+
## 🚀 Project Structure
17+
18+
Inside of your Astro + Starlight project, you'll see the following folders and files:
19+
20+
```
21+
.
22+
├── public/
23+
├── src/
24+
│ ├── assets/
25+
│ ├── content/
26+
│ │ ├── docs/
27+
│ └── content.config.ts
28+
├── astro.config.mjs
29+
├── package.json
30+
└── tsconfig.json
31+
```
32+
33+
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
34+
35+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
36+
37+
Static assets, like favicons, can be placed in the `public/` directory.
38+
39+
## 🧞 Commands
40+
41+
All commands are run from the root of the project, from a terminal:
42+
43+
| Command | Action |
44+
| :------------------------ | :----------------------------------------------- |
45+
| `npm install` | Installs dependencies |
46+
| `npm run dev` | Starts local dev server at `localhost:4321` |
47+
| `npm run build` | Build your production site to `./dist/` |
48+
| `npm run preview` | Preview your build locally, before deploying |
49+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
50+
| `npm run astro -- --help` | Get help using the Astro CLI |
51+
52+
## 👀 Want to learn more?
53+
54+
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).

docs/astro.config.mjs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config';
3+
import starlight from '@astrojs/starlight';
4+
5+
// https://astro.build/config
6+
export default defineConfig({
7+
integrations: [
8+
starlight({
9+
title: 'terraform-proxmox-talos-cluster',
10+
social: {
11+
github: 'https://github.com/pascalinthecloud/terraform-proxmox-talos-cluster',
12+
},
13+
sidebar: [
14+
{
15+
label: 'Guides',
16+
items: [
17+
// Each item here is one entry in the navigation menu.
18+
{ label: 'Upgrade talos', slug: 'guides/upgrade_talos' },
19+
{ label: 'Setup talos cluster', slug: 'guides/setup' },
20+
],
21+
},
22+
{
23+
label: 'Reference',
24+
autogenerate: { directory: 'reference' },
25+
},
26+
],
27+
}),
28+
],
29+
});

0 commit comments

Comments
 (0)