-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (74 loc) · 2.49 KB
/
Copy pathdocs.yml
File metadata and controls
87 lines (74 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: docs
on:
# Publish docs whenever the default branch changes.
push:
branches: [main]
# Allow manual runs from the Actions tab.
workflow_dispatch:
# id-token is required for JFrog OIDC and for the Pages deployment; pages:write
# is required to publish the site.
permissions:
contents: read
id-token: write
pages: write
# Allow one concurrent deployment. Queued runs wait rather than cancel an
# in-progress publish.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
name: Build docs
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup JFrog CLI
uses: jfrog/setup-jfrog-cli@deda456d982fc5e9a7a020b63eb0d2968aedd33e # v5.1.0
env:
JF_URL: https://databricks.jfrog.io
with:
oidc-provider-name: github-actions
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '22'
cache: 'npm'
- name: Configure npm for JFrog
run: jf npmc --repo-resolve=db-npm
- name: Install dependencies
run: jf npm ci
# Builds every package, then runs TypeDoc into site/api (see typedoc.json).
- name: Build documentation
run: npm run docs
# The API reference lives at /api/; redirect the site root there so the
# bare Pages URL is not a 404.
- name: Add root redirect to /api/
run: |
cat > site/index.html <<'EOF'
<!doctype html>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./api/">
<link rel="canonical" href="./api/">
<title>Databricks SDK for JavaScript</title>
EOF
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0