Skip to content

Commit b4485ab

Browse files
authored
Merge pull request #2050 from squidowl/nightly-docs
Nightly Documentation
2 parents ebbf868 + 534f628 commit b4485ab

4 files changed

Lines changed: 24 additions & 37 deletions

File tree

.github/workflows/pages.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: Deploy Documentation
22

33
on:
4-
push:
5-
tags:
6-
- "*"
7-
paths:
8-
- "docs/**"
9-
- ".github/workflows/pages.yml"
10-
workflow_dispatch:
4+
workflow_run:
5+
workflows:
6+
- Docs Check
7+
types:
8+
- completed
9+
branches:
10+
- main
1111

1212
permissions:
1313
contents: read
@@ -22,6 +22,8 @@ jobs:
2222
build:
2323
runs-on: ubuntu-latest
2424
env:
25+
DOCS_CHANNEL: nightly
26+
DOCS_SHA: ${{ github.sha }}
2527
DOCS_BASE: /
2628
steps:
2729
- name: Checkout

docs/.vitepress/config.mts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import footnote from "markdown-it-footnote";
22
import { defineConfig } from "vitepress";
33

4+
const releaseLabel = process.env.DOCS_VERSION ?? "Latest Release";
5+
const releaseLink = process.env.DOCS_CHANNEL === "nightly" ? "https://halloy.chat" : "/";
6+
const nightlyLabel = process.env.DOCS_SHA
7+
? `Nightly (${process.env.DOCS_SHA.slice(0, 7)})`
8+
: "Nightly";
9+
const nightlyLink = process.env.DOCS_CHANNEL === "nightly" ? "/" : "https://nightly.halloy.chat";
10+
const docsChannel = process.env.DOCS_CHANNEL === "nightly" ? nightlyLabel : releaseLabel;
11+
412
export default defineConfig({
513
title: "Halloy",
614
description:
@@ -30,6 +38,13 @@ export default defineConfig({
3038
level: [2, 4],
3139
},
3240
nav: [
41+
{
42+
text: docsChannel,
43+
items: [
44+
{ text: releaseLabel, link: releaseLink },
45+
{ text: nightlyLabel, link: nightlyLink },
46+
],
47+
},
3348
{
3449
text: "Themes",
3550
link: "https://themes.halloy.chat/",

docs/nightly.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/release.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)