Skip to content

Commit 4ee5b97

Browse files
authored
Merge pull request #2 from metabase/github_action_to_read_from_main_metabase
2 parents b46444c + f3032c5 commit 4ee5b97

File tree

2,666 files changed

+5427
-45710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,666 files changed

+5427
-45710
lines changed

.eslintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
*.bundle.js
3+
*.min.js
4+
*.hot-update.js
5+
**/dist/*.js
6+
_docs/**/*
7+
_site/**/*.js
8+
vendor/**/*.js
9+
10+
_lp/v/*

.eslintrc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"extends": ["eslint:recommended", "plugin:react/recommended"],
3+
"env": {
4+
"browser": true,
5+
"es6": true,
6+
"commonjs": true,
7+
"jest": true
8+
},
9+
"parserOptions": {
10+
"ecmaVersion": 2018,
11+
"sourceType": "module",
12+
"ecmaFeatures": {
13+
"jsx": true
14+
}
15+
},
16+
"globals": {
17+
"__dirname": "readonly",
18+
"_vwo_code": "readonly",
19+
"anchors": "readonly",
20+
"Buffer": "readonly",
21+
"contentLoaded": "readonly",
22+
"cy": "readonly",
23+
"dataLayer": "readonly",
24+
"ga": "readonly",
25+
"gdprCookieNotice": "readonly",
26+
"gdprCookieNoticeLocales": "writable",
27+
"lunr": "readonly",
28+
"MediumLightbox": "readonly",
29+
"process": "readonly",
30+
"scrollIntoView": "readonly",
31+
"settings_timer": "readonly"
32+
},
33+
"rules": {
34+
"prefer-const": 2,
35+
"react/prop-types": 1
36+
}
37+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Jekyll Build Workflow
2+
3+
# When this gets called, we should have stuff at all _docs/<branch>/
4+
5+
on:
6+
workflow_run:
7+
workflows: ["Process Branches"]
8+
types:
9+
- completed
10+
11+
jobs:
12+
final-job:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Final Step
16+
run: echo "All branch processing jobs have completed!"
17+
- name: Check _docs contents
18+
run: ls -al _docs
19+
- name: start the build
20+
run: script/build
21+
- name: check output
22+
run: ls -al _site
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Process Docs Changes
2+
on:
3+
# pull_request:
4+
# branches:
5+
# - master
6+
workflow_dispatch:
7+
inputs:
8+
branch_name:
9+
description: Which `metabase/metabase` branch triggered this workflow
10+
required: true
11+
type: string
12+
13+
jobs:
14+
build-and-commit:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Display received payload
20+
run: |
21+
echo "Got branch_name: ${{ github.event.inputs.branch_name }}"
22+
23+
- name: Install dependencies
24+
run: yarn install --frozen-lockfile --prefer-offline
25+
26+
- name: Set up Ruby # uses version from .ruby-version
27+
uses: ruby/setup-ruby@d5fb7a202fc07872cb44f00ba8e6197b70cb0c55 # v1.179.0
28+
with:
29+
bundler-cache: true
30+
31+
- name: Install dependencies
32+
run: bundle install
33+
34+
- name: Update docs
35+
run: |
36+
./script/docs-update
37+
./script/docs master --set-version master
38+
39+
- name: "Lint the markdown"
40+
run: |
41+
yarn lint-markdown
42+
43+
- name: "Lint the styles"
44+
run: |
45+
yarn lint-styles
46+
47+
- name: "Lint the scripts"
48+
run: |
49+
yarn lint-scripts
50+
51+
- name: "Validate the links"
52+
run: |
53+
yarn lint-links
54+
55+
56+
- name: Build the Jekyll Site
57+
env:
58+
JEKYLL_ENV: staging
59+
NODE_ENV: production
60+
run: |
61+
# Clear the existing site:
62+
rm -rf _site
63+
# Run the jekyll server:
64+
JEKYLL_ENV=development bundle exec jekyll build --baseurl '' --config _config.docs.yml --trace
65+
66+
- name: Setup Babashka
67+
uses: turtlequeue/setup-babashka@v1.7.0
68+
with:
69+
babashka-version: 1.12.197
70+
- name: Check bb runs
71+
run: bb --version
72+
73+
- name: "Check all of the links"
74+
run: |
75+
script/links || true
76+
echo 'checking reported links...'
77+
echo "htmlproofer spit out a report of length: $(cat htmlproofer.out | wc -l)"
78+
bb script/analyze_links.clj --htmlproofer-output htmlproofer.out
79+
80+
- name: Create the pull request
81+
env:
82+
GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
83+
run: |
84+
if git diff --quiet ; then
85+
echo "No changes to commit."
86+
else
87+
git config user.email "metabase-bot@metabase.com"
88+
git config user.name "Metabase Docs bot"
89+
update_branch="docs-update"
90+
91+
# Check out or create the update branch
92+
if git ls-remote --exit-code --heads origin "$update_branch" > /dev/null; then
93+
git fetch origin "$update_branch"
94+
git switch "$update_branch"
95+
else
96+
git switch --create "$update_branch"
97+
fi
98+
99+
git add _site
100+
git commit --author="Metabase Docs bot <metabase-bot@metabase.com>" --message="Update master and latest docs"
101+
git push --force origin "$update_branch"
102+
103+
# Check if a PR already exists for this branch
104+
existing_pr=$(gh pr list --head "$update_branch" --json number --jq '.[0].number')
105+
106+
if [ -z "$existing_pr" ]; then
107+
gh pr create \
108+
--title "Refresh docs (${{ github.event.inputs.branch_name }})" \
109+
--body "" \
110+
--head "$update_branch"
111+
else
112+
echo "PR already exists: #$existing_pr"
113+
fi
114+
fi

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/node_modules/
2+
.DS_Store
3+
.idea
4+
*.log
5+
tmp/
6+
/htmlproofer.out
7+
/.clj-kondo/
8+
/.lsp/

.markdownlint.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"default": true,
3+
"commands-show-output": false,
4+
"first-line-h1": false,
5+
"line-length": false,
6+
"list-indent": false,
7+
"no-bare-urls": false,
8+
"no-emphasis-as-header": false,
9+
"no-inline-html": false,
10+
"no-trailing-punctuation": {
11+
"punctuation": ".,;:"
12+
},
13+
"single-h1": { "front_matter_title": "" },
14+
"ul-indent": { "indent": 2 }
15+
}

.markdownlintignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
example_dbs/**/*
3+
script/**/*
4+
spec/**/*
5+
_docs/**/*
6+
_site/**/*
7+
vendor/**/*

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.3.2

.stylelintignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
**/bootstrap/**/*.css
2+
**/bootstrap/**/*.scss
3+
4+
**/dist/**/*.css
5+
**/dist/**/*.scss
6+
7+
vendor/**/*.css
8+
vendor/**/*.scss
9+
10+
_docs/**/embedding/sdk/api/**
11+
12+
_site/**/*.css
13+
_site/**/*.scss
14+
15+
css/**/*.scss
16+
17+
_lp/v/*

.stylelintrc

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"extends": "stylelint-config-standard-scss",
3+
"plugins": [
4+
"stylelint-order"
5+
],
6+
"rules": {
7+
"alpha-value-notation": "number",
8+
"color-function-notation": "legacy",
9+
"color-no-invalid-hex": true,
10+
"max-line-length": [
11+
120,
12+
{
13+
"ignorePattern": "/(filter|transition): /"
14+
}
15+
],
16+
"order/properties-alphabetical-order": true,
17+
"selector-class-pattern": [
18+
"^([a-z][a-z0-9]*)(-(-*)[a-z0-9]+)*$",
19+
{
20+
"resolveNestedSelectors": true,
21+
"severity": "warning"
22+
}
23+
],
24+
"selector-id-pattern": [
25+
"^([a-z][a-z0-9]*)(-[a-z0-9]+)*$",
26+
{
27+
"severity": "warning"
28+
}
29+
],
30+
"scss/at-extend-no-missing-placeholder": null,
31+
"scss/at-if-no-null": [
32+
true,
33+
{
34+
"severity": "warning"
35+
}
36+
],
37+
"scss/no-global-function-names": [
38+
true,
39+
{
40+
"severity": "warning"
41+
}
42+
]
43+
},
44+
"overrides": [
45+
{
46+
"files": [
47+
"css/**/*.css",
48+
"_sass/**/*.scss"
49+
],
50+
"rules": {
51+
"no-descending-specificity": [
52+
true,
53+
{
54+
"severity": "warning"
55+
}
56+
],
57+
"no-duplicate-selectors": [
58+
true,
59+
{
60+
"severity": "warning"
61+
}
62+
]
63+
}
64+
}
65+
]
66+
}

0 commit comments

Comments
 (0)