Skip to content

Commit e736bd0

Browse files
Merge branch 'main' of https://github.com/supabase-community/postgres_lsp into feat/to-role
2 parents b5e82ed + 3ce7496 commit e736bd0

File tree

8 files changed

+179
-561
lines changed

8 files changed

+179
-561
lines changed

.github/workflows/deploy_docs.yml

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

33
on:
4+
push:
5+
branches:
6+
- main
7+
# paths:
8+
# - "docs/**"
9+
# - "mkdocs.yml"
410
release:
5-
types: [released]
6-
workflow_dispatch:
11+
types: [published]
712

813
permissions:
914
contents: write
@@ -13,25 +18,36 @@ permissions:
1318
jobs:
1419
build:
1520
runs-on: ubuntu-latest
16-
1721
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v4
22+
- uses: actions/checkout@v4
2023
with:
2124
fetch-depth: 0
2225

2326
- name: Install uv
2427
uses: astral-sh/setup-uv@v5
2528
with:
26-
enable-cache: true
29+
enable-cache: true
2730

2831
- name: Set up Python
2932
run: uv python install
3033

3134
- name: Install the project
3235
run: uv sync --all-extras --dev
3336

34-
- run: uv run mkdocs gh-deploy --force
37+
- name: Configure Git
38+
run: |
39+
git config user.name 'github-actions[bot]'
40+
git config user.email 'github-actions[bot]@users.noreply.github.com'
41+
42+
- name: Build Docs Website
43+
run: |
44+
if [ "${{ github.event_name }}" = "release" ]; then
45+
uv run mike deploy --push --update-aliases ${{ github.event.release.tag_name }} latest
46+
uv run mike set-default --push ${{ github.event.release.tag_name }}
47+
else
48+
uv run mike deploy --push main
49+
uv run mike set-default --push main
50+
fi
3551
3652
deploy:
3753
needs: build
@@ -44,12 +60,16 @@ jobs:
4460
uses: actions/checkout@v4
4561
with:
4662
ref: gh-pages
63+
4764
- name: Setup Pages
4865
uses: actions/configure-pages@v5
66+
4967
- name: Upload artifact
5068
uses: actions/upload-pages-artifact@v3
5169
with:
5270
path: '.'
71+
5372
- name: Deploy to GitHub Pages
5473
id: deployment
5574
uses: actions/deploy-pages@v4
75+

crates/pgt_workspace/src/configuration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ pub fn create_config(
186186
configuration.schema = node_schema_path.to_str().map(String::from);
187187
} else if VERSION == "0.0.0" {
188188
// VERSION is 0.0.0 if it has not been explicitly set (e.g local dev, as fallback)
189-
configuration.schema = Some("https://pgtools.dev/schemas/latest/schema.json".to_string());
189+
configuration.schema = Some("https://pgtools.dev/latest/schema.json".to_string());
190190
} else {
191-
configuration.schema = Some(format!("https://pgtools.dev/schemas/{VERSION}/schema.json"));
191+
configuration.schema = Some(format!("https://pgtools.dev/{VERSION}/schema.json"));
192192
}
193193

194194
let contents = serde_json::to_string_pretty(&configuration)

docs/codegen/src/schema.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use pgt_configuration::{PartialConfiguration, VERSION};
1+
use pgt_configuration::PartialConfiguration;
22
use schemars::{
33
schema::{RootSchema, Schema, SchemaObject},
44
schema_for,
@@ -10,25 +10,10 @@ use std::{fs, path::Path};
1010
///
1111
/// * `docs_dir`: Path to the docs directory.
1212
pub fn generate_schema(docs_dir: &Path) -> anyhow::Result<()> {
13-
let schemas_dir = docs_dir.join("schemas");
14-
let latest_schema_dir = schemas_dir.join("latest");
15-
let latest_schema_path = latest_schema_dir.join("schema.json");
16-
17-
let version_schema_dir = schemas_dir.join(VERSION);
18-
let version_schema_path = version_schema_dir.join("schema.json");
19-
20-
if !latest_schema_dir.exists() {
21-
fs::create_dir_all(&latest_schema_dir)?;
22-
}
23-
24-
if !version_schema_dir.exists() {
25-
fs::create_dir_all(&version_schema_dir)?;
26-
}
27-
13+
let schema_path = docs_dir.join("schema.json");
2814
let schema_content = get_configuration_schema_content()?;
2915

30-
fs::write(latest_schema_path, &schema_content)?;
31-
fs::write(version_schema_path, &schema_content)?;
16+
fs::write(schema_path, &schema_content)?;
3217

3318
Ok(())
3419
}
File renamed without changes.

0 commit comments

Comments
 (0)