Skip to content

Commit beb3b7c

Browse files
committed
update deployment
1 parent 7f36b4d commit beb3b7c

File tree

5 files changed

+108
-25
lines changed

5 files changed

+108
-25
lines changed

.github/workflows/docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish Docs
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- docs/**
10+
- website/**
11+
- .github/workflows/docs.yml
12+
13+
jobs:
14+
publish-docs:
15+
runs-on: ubuntu-latest
16+
environment:
17+
name: Docs
18+
url: https://lemoncode.github.io/react-image-focal-point
19+
steps:
20+
- name: Checkout Repository
21+
uses: actions/checkout@v3
22+
23+
- name: Add NPM registry
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: 18.x
27+
28+
- name: Use SSH key
29+
run: |
30+
mkdir -p ~/.ssh/
31+
echo "${{secrets.SSH_PRIVATE_KEY}}" > ~/.ssh/id_rsa
32+
sudo chmod 600 ~/.ssh/id_rsa
33+
34+
- name: Config git
35+
run: |
36+
git config --global user.email "docs@lemoncode.net"
37+
git config --global user.name "Docs bot"
38+
39+
- name: Install
40+
run: npm ci
41+
42+
- name: Publish Docs
43+
run: |
44+
cd ./website
45+
npm run build
46+
npm run deploy

.github/workflows/publish-packages.yml renamed to .github/workflows/packages.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
branches:
66
- main
7+
paths-ignore:
8+
- docs/**
9+
- website/**""
10+
- .github/workflows/docs.yml
711

812
jobs:
913
publish-package:

website/docusaurus.config.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@
44
const lightCodeTheme = require('prism-react-renderer/themes/github');
55
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
66

7+
const organizationName = 'lemoncode';
8+
const projectName = 'react-image-focal-point';
9+
710
/** @type {import('@docusaurus/types').Config} */
811
const config = {
912
title: 'React Image Focal Point',
1013
tagline: 'Image focal point component for React',
1114
favicon: 'img/favicon.ico',
1215

13-
// Set the production url of your site here
14-
// TODO.
15-
url: 'https://your-docusaurus-test-site.com',
16-
baseUrl: '/',
17-
organizationName: 'lemoncode',
18-
projectName: 'react-image-focal-point',
16+
url: `https://${organizationName}.github.io`,
17+
baseUrl: `/${projectName}`,
18+
organizationName,
19+
projectName,
20+
trailingSlash: false,
1921
onBrokenLinks: 'throw',
2022
onBrokenMarkdownLinks: 'warn',
2123
i18n: {
@@ -45,7 +47,7 @@ const config = {
4547
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
4648
({
4749
// TODO: Update image
48-
image: 'img/docusaurus-social-card.jpg',
50+
image: 'img/todo-social-card.jpg',
4951
navbar: {
5052
title: 'React Image Focal Point',
5153
logo: {
@@ -82,6 +84,14 @@ const config = {
8284
label: 'Getting Started',
8385
to: '/docs/getting-started',
8486
},
87+
{
88+
label: 'Examples',
89+
to: '/docs/examples/basic',
90+
},
91+
{
92+
label: 'API',
93+
to: '/docs/api/reference',
94+
},
8595
],
8696
},
8797
{

website/package.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "docs-website",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"start": "docusaurus start",
7+
"build": "docusaurus build",
8+
"deploy": "docusaurus deploy",
9+
"serve": "docusaurus serve"
10+
},
11+
"dependencies": {
12+
"@docusaurus/core": "2.3.1",
13+
"@docusaurus/preset-classic": "2.3.1",
14+
"@mdx-js/react": "1.6.22",
15+
"clsx": "^1.2.1",
16+
"prism-react-renderer": "1.3.5",
17+
"react": "17.0.2",
18+
"react-dom": "17.0.2"
19+
},
20+
"devDependencies": {
21+
"@docusaurus/module-type-aliases": "2.3.1",
22+
"@docusaurus/remark-plugin-npm2yarn": "2.3.1",
23+
"@tsconfig/docusaurus": "1.0.6",
24+
"typescript": "4.9.5"
25+
},
26+
"browserslist": {
27+
"production": [
28+
">0.5%",
29+
"not dead",
30+
"not op_mini all"
31+
],
32+
"development": [
33+
"last 1 chrome version",
34+
"last 1 firefox version",
35+
"last 1 safari version"
36+
]
37+
},
38+
"engines": {
39+
"node": ">=16.14"
40+
}
41+
}

website/src/pages/index.module.css

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

0 commit comments

Comments
 (0)