Skip to content

Commit 96540c4

Browse files
committed
update workflow
1 parent 9d63d2f commit 96540c4

File tree

5 files changed

+105
-92
lines changed

5 files changed

+105
-92
lines changed

.github/workflows/publish-docs.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Publish Mintlify Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # Run on all branches
7+
paths:
8+
- 'docs/**'
9+
- '.github/workflows/publish-docs.yml'
10+
workflow_dispatch: # Allow manual trigger
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment per branch
18+
concurrency:
19+
group: pages-${{ github.ref_name }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20'
33+
34+
- name: Install Mintlify
35+
run: npm install -g mintlify
36+
37+
- name: Build docs
38+
run: |
39+
cd docs
40+
mintlify build
41+
42+
- name: Get branch name
43+
id: branch
44+
run: |
45+
# Get the branch name and sanitize it for use in URL
46+
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
47+
# Replace slashes with dashes for subdirectory name
48+
SANITIZED_BRANCH=$(echo "$BRANCH_NAME" | sed 's/\//-/g')
49+
echo "name=$SANITIZED_BRANCH" >> $GITHUB_OUTPUT
50+
echo "Building docs for branch: $BRANCH_NAME (subdirectory: $SANITIZED_BRANCH)"
51+
52+
- name: Prepare deployment directory
53+
run: |
54+
mkdir -p _site/${{ steps.branch.outputs.name }}
55+
cp -r docs/_site/* _site/${{ steps.branch.outputs.name }}/
56+
57+
# Create/update index.html with branch listing
58+
cat > _site/index.html <<EOF
59+
<!DOCTYPE html>
60+
<html>
61+
<head>
62+
<title>TestDriver Documentation</title>
63+
<style>
64+
body { font-family: system-ui, -apple-system, sans-serif; max-width: 800px; margin: 50px auto; padding: 20px; }
65+
h1 { color: #152a65; }
66+
ul { list-style: none; padding: 0; }
67+
li { margin: 10px 0; }
68+
a { color: #b3d334; text-decoration: none; font-size: 18px; }
69+
a:hover { text-decoration: underline; }
70+
</style>
71+
</head>
72+
<body>
73+
<h1>TestDriver Documentation</h1>
74+
<p>Available documentation versions:</p>
75+
<ul>
76+
<li><a href="${{ steps.branch.outputs.name }}/">${{ steps.branch.outputs.name }}</a></li>
77+
</ul>
78+
</body>
79+
</html>
80+
EOF
81+
82+
- name: Upload artifact
83+
uses: actions/upload-pages-artifact@v3
84+
with:
85+
path: '_site'
86+
87+
deploy:
88+
needs: build
89+
runs-on: ubuntu-latest
90+
environment:
91+
name: github-pages
92+
url: ${{ steps.deployment.outputs.page_url }}
93+
steps:
94+
- name: Deploy to GitHub Pages
95+
id: deployment
96+
uses: actions/deploy-pages@v4
97+
98+
- name: Output deployment URL
99+
run: |
100+
echo "Documentation deployed to: ${{ steps.deployment.outputs.page_url }}${{ needs.build.outputs.branch_name }}"

test/testdriver/exec-output.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import { describe, expect, it } from "vitest";
77
import { TestDriver } from "../../lib/vitest/hooks.mjs";
88

9-
describe("Exec Output Test", () => {
10-
it.skipIf(process.env.TD_OS === "linux")(
9+
describe.skipIf(process.env.TD_OS === "linux")("Exec Output Test", () => {
10+
it(
1111
"should set date using PowerShell and navigate to calendar",
1212
async (context) => {
1313
const testdriver = TestDriver(context, { headless: true });

test/testdriver/exec-pwsh.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import { describe, expect, it } from "vitest";
77
import { TestDriver } from "../../lib/vitest/hooks.mjs";
88

9-
describe("Exec PowerShell Test", () => {
10-
it.skipIf(process.env.TD_OS === "linux")(
9+
describe.skipIf(process.env.TD_OS === "linux")("Exec PowerShell Test", () => {
10+
it(
1111
"should generate random email using PowerShell and enter it",
1212
async (context) => {
1313
const testdriver = TestDriver(context, { headless: true });

test/testdriver/presets-example.test.mjs

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

test/testdriver/setup/lifecycleHelpers.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* await dashcam.auth();
1111
*/
1212

13-
import Dashcam from '../../../src/core/Dashcam.js';
13+
import Dashcam from '../../../lib/core/Dashcam.js';
1414

1515
// Module-level cache to maintain Dashcam instance state across helper calls
1616
const dashcamInstances = new WeakMap();

0 commit comments

Comments
 (0)