Skip to content

Commit

Permalink
ci: change pipeline and fix building docs
Browse files Browse the repository at this point in the history
  • Loading branch information
QuadStingray committed Nov 2, 2023
1 parent 6f25049 commit d432083
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
28 changes: 27 additions & 1 deletion .github/workflows/release_and_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,35 @@ jobs:
body: ${{ steps.changelog.outputs.changes }}
token: ${{ github.token }}

- name: Update versions file
run: |
echo "{\"mongocamp\": \"${{ github.ref_name }}\"}" > ./docs/versions.json;
git add ./docs/versions.json
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }}'
file_pattern: CHANGELOG.md
file_pattern: CHANGELOG.md

- name: Set up JDK
uses: coursier/setup-action@v1
with:
jvm: graalvm-java17:22.3.3
apps: sbt scala scalac

- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 6.0.2

- name: Build and deploy Docu
env:
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "MongoCamp CI"
sh ./deploy_ghpages.sh
7 changes: 4 additions & 3 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Unocss from 'unocss/vite'
import {defineConfig} from 'vitepress'
import {version} from '../../package.json'
import {SearchPlugin} from 'vitepress-plugin-search'
import fs from 'fs'

export default defineConfig({
lang: 'en-US',
Expand Down Expand Up @@ -50,6 +49,8 @@ export default defineConfig({
})

function nav() {
var versionInfos = JSON.parse(fs.readFileSync('docs/versions.json', 'utf-8'))

return [
{
text: 'Documentation',
Expand All @@ -63,7 +64,7 @@ function nav() {
]
},
{
text: version,
text: versionInfos.mongocamp,
items: [
{
text: 'Changelog',
Expand Down
1 change: 1 addition & 0 deletions docs/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"mongocamp": "2.6.6"}

0 comments on commit d432083

Please sign in to comment.