Skip to content

Commit

Permalink
feat(ITSM-105): transfer docusaurus from docs.1inch.io (#1)
Browse files Browse the repository at this point in the history
* feat(ITSM-105): transfer docusaurus from docs.1inch.io
  • Loading branch information
raverianov authored Jul 9, 2024
1 parent c2f601f commit 679b359
Show file tree
Hide file tree
Showing 154 changed files with 36,174 additions and 0 deletions.
Binary file modified .DS_Store
Binary file not shown.
76 changes: 76 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Deploy

on:
# push:
# branches:
# - master
# paths-ignore:
# - .github/**
# manual trigger
workflow_dispatch:

jobs:
# Wait for up to a minute for previous run to complete, abort if not done by then
pre-run:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: 'Block Concurrent Executions'
uses: softprops/turnstyle@v1
with:
poll-interval-seconds: 10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

bump_version:
name: Bump Version
needs: pre-run
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.github_tag_action.outputs.new_tag }}
changelog: ${{ steps.github_tag_action.outputs.changelog }}
steps:
- name: Checkout
uses: actions/[email protected]

- name: Bump version and push tag
id: github_tag_action
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: master
fetch_all_tags: true

deploy:
name: Deploy
needs: pre-run
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.17.1'

- name: Install pnpm and dependencies
run: |
npm install -g [email protected]
pnpm install
- name: Build production
run: pnpm run build

- name: Deploy to Cloudflare Pages
if: github.ref == 'refs/heads/staging'
uses: cloudflare/wrangler-action@v3
env:
projectName: governance-1inch-community
distDir: build
branch: main
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }}
accountId: e34eeb161ddd9fee77da1de105a9141b
packageManager: pnpm
command: pages deploy ${{ env.distDir }} --project-name=${{ env.projectName }} --branch=${{ env.branch }} --commit-dirty=true
31 changes: 31 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches-ignore:
- master
paths-ignore:
- .github/**
# manual trigger
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.17.1'

- name: Install pnpm and dependencies
run: |
npm install -g [email protected]
pnpm install
- name: Build production
run: pnpm run build
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

.idea
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
170 changes: 170 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

/** @type {import('@docusaurus/types').Config} */
const config = {
title: '1inch Network',
tagline:
'The 1inch Network unites decentralized protocols whose synergy enables the most lucrative, fastest and protected operations in the DeFi space.',
url: 'https://docs.1inch.io',
baseUrl: '/',
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon/favicon.ico',
organizationName: '1inch', // Usually your GitHub org/user name.
projectName: '1inch-docs', // Usually your repo name.
plugins: [
[
require.resolve('docusaurus-plugin-search-local'),
{ indexPages: true, highlightSearchTermsOnTargetPage: true, searchResultLimits: 10 },
],
],
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl: 'https://github.com/1inch/1inch-docs/edit/master/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl: 'https://github.com/1inch/1inch-docs/edit/master/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: '1inch Network Docs',
logo: {
alt: '1inch',
src: '/img/1inch_logo_without_text.svg',
},
items: [
{
label: 'Protocols',
position: 'left',
items: [
{
label: 'Aggregation Protocol',
href: '/docs/aggregation-protocol/introduction/',
},
{
label: 'Fusion Swap',
href: '/docs/fusion-swap/introduction/',
},
{
label: 'Limit Order Protocol',
href: '/docs/limit-order-protocol/introduction/',
},
{
label: 'Spot Price Aggregator',
href: '/docs/spot-price-aggregator/introduction/',
},
{
label: 'RabbitHole',
href: '/docs/rabbithole/summary/',
},
],
},
{
label: 'Governance',
position: 'left',
type: 'doc',
docId: 'governance/overview',
},
{
label: 'Open Source',
position: 'left',
items: [
{
label: 'Limit order contract',
href: 'https://github.com/1inch/limit-order-protocol',
},
{
label: 'Multicall',
href: 'https://github.com/1inch/multicall',
},
{
label: 'EIP-2612 utils library',
href: 'https://github.com/1inch/permit-signed-approvals-utils',
},
{
label: 'Cumulative merkle drop',
href: 'https://github.com/1inch/merkle-distribution',
},
],
},
{
"label": "Developer links",
"position": "right",
"items": [
{
label: 'Grants Program',
href: 'https://1inch.io/foundation-grant-program/',
},
{
label: 'Bug bounty',
href: 'https://airtable.com/shrddQOOkm3hOLuzd',
},
{
href: 'https://www.npmjs.com/search?q=%401inch',
label: 'NPM'
},
{
href: 'https://github.com/1inch',
label: 'GitHub'
}
]
}
]
},
typesense: {
typesenseCollectionName: '1inch-docs',
typesenseServerConfig: {
nearestNode: {
host: 'fsn-typesense.1inch.io',
port: 443,
protocol: 'https',
},
nodes: [
{
host: 'fsn-typesense.1inch.io',
port: 443,
protocol: 'https',
},
{
host: 'hel-typesense.1inch.io',
port: 443,
protocol: 'https',
},
],
apiKey: 'PkWe6bmCzamVA4lw1Z5ZmRjdG0BQ7Cvh',
},

typesenseSearchParameters: {},

contextualSearch: false,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ['solidity'],
},
}),
};

module.exports = config;
Loading

0 comments on commit 679b359

Please sign in to comment.