Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbch committed Jul 5, 2024
2 parents f16e995 + fc54946 commit 402ff2b
Show file tree
Hide file tree
Showing 23 changed files with 702 additions and 124 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
*Dockerfile*
npm-debug.log
node_modules
.env
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Automate, customize, and execute your software development workflows right in your repository with GitHub Actions.
# Documentation: https://docs.github.com/en/actions

name: deploy

on:
workflow_dispatch:
push:
branches:
- main
- development

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Trigger build
shell: bash
run: |
curl \
--fail \
--silent \
--request POST \
--form token=${{ secrets.CI_TOKEN }} \
--form ref=main \
--form 'variables[GITHUB_COMMIT_REF_NAME]'=$GITHUB_REF_NAME \
${{ secrets.CI_WEBHOOK_URL }} \
&> /dev/null
25 changes: 24 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
FROM node:20-alpine AS base

ARG BASE_PATH

ARG NEXT_PUBLIC_ENVIRONMENT
ARG NEXT_PUBLIC_DOMAIN
ARG NEXT_PUBLIC_BASE_PATH
ARG NEXT_PUBLIC_REPO
ARG NEXT_PUBLIC_REPO_BASE
ARG NEXT_PUBLIC_DEMO_URL
ARG NEXT_PUBLIC_DEMO_URL_PRO

ARG NEXT_PUBLIC_DOCSEARCH_HOST
ARG NEXT_PUBLIC_DOCSEARCH_PORT
ARG NEXT_PUBLIC_DOCSEARCH_PROTOCOL
ARG NEXT_PUBLIC_DOCSEARCH_INDEX
ARG NEXT_PUBLIC_DOCSEARCH_API_KEY

ARG NEXT_PUBLIC_GTM_ID
ARG NEXT_PUBLIC_COOKIEBOT_ID

ARG NEXT_TELEMETRY_DISABLED

RUN apk add --no-cache curl

# 1. Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
Expand Down Expand Up @@ -57,4 +80,4 @@ EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME 0.0.0.0

CMD ["node", "server.js"]
CMD ["node", "server.js"]
32 changes: 12 additions & 20 deletions docsearch.config.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
{
"index_name": "tiptap_v2",
"start_urls": [
"https://tiptap.dev/docs"
],
"sitemap_urls": [
"https://tiptap.dev/docs/sitemap.xml"
],
"start_urls": ["https://tiptap.dev/docs"],
"sitemap_urls": ["https://tiptap.dev/docs/sitemap.xml"],
"sitemap_alternate_links": true,
"stop_urls": [],
"selectors": {
"default": {
"lvl0": {
"selector": "a[data-breadcrumb=\"0\"]",
"global": true,
"default_value": "All docs"
"selector": "a[data-breadcrumb=\"0\"]",
"global": true,
"default_value": "All docs"
},
"lvl1": "h1",
"lvl2": "h2",
"lvl3": "h3",
"lvl4": "h4",
"lvl5": "h5",
"lvl6": "h6",
"text": "p, li, pre, td"
"text": "p, li, pre, td",
"code": {
"selector": "pre > code",
"global": true
}
}
},
"strip_chars": " .,;:#",
"custom_settings": {
"separatorsToIndex": "_",
"attributesForFaceting": [
"type",
"lang"
],
"attributesToRetrieve": [
"hierarchy",
"text",
"anchor",
"url"
]
"attributesForFaceting": ["type", "lang"],
"attributesToRetrieve": ["hierarchy", "text", "anchor", "url"]
}
}
33 changes: 16 additions & 17 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import createMdx from "@next/mdx";
import remarkFrontmatter from "remark-frontmatter";
import remarkMdxFrontmatter from "remark-mdx-frontmatter";
import rehypeHighlight from "rehype-highlight";
import remarkGfm from "remark-gfm";
import createMdx from '@next/mdx'
import remarkFrontmatter from 'remark-frontmatter'
import remarkMdxFrontmatter from 'remark-mdx-frontmatter'
import rehypeHighlight from 'rehype-highlight'
import remarkGfm from 'remark-gfm'

/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
webpack(config) {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find((rule) =>
rule.test?.test?.(".svg"),
);
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg'))

config.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
Expand All @@ -24,18 +23,18 @@ const nextConfig = {
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
use: ["@svgr/webpack"],
use: ['@svgr/webpack'],
},
);
)

// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i;
fileLoaderRule.exclude = /\.svg$/i

return config;
return config
},
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
images: { unoptimized: true },
basePath: process.env.BASE_PATH ?? "",
basePath: process.env.BASE_PATH ?? '',
async redirects() {
return [
{
Expand All @@ -45,13 +44,13 @@ const nextConfig = {
},
]
},
};
}

const withMDX = createMdx({
options: {
remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter, remarkGfm],
rehypePlugins: [rehypeHighlight],
},
});
})

export default withMDX(nextConfig);
export default withMDX(nextConfig)
Loading

0 comments on commit 402ff2b

Please sign in to comment.