Skip to content

Commit 249fbc5

Browse files
committed
chore: gh workflow
1 parent 7c8230a commit 249fbc5

File tree

6 files changed

+81
-21
lines changed

6 files changed

+81
-21
lines changed

.github/workflows/dev.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Injective Chain canonical docs deployment
2+
on:
3+
push:
4+
branches: [dev]
5+
6+
jobs:
7+
release:
8+
runs-on: self-hosted
9+
env:
10+
SSH_USER: ${{ secrets.DEVNET_SSH_USER }}
11+
SSH_KEY: ${{ secrets.DEVNET_SSH_KEY }}
12+
SSH_HOST: ${{ secrets.DEVNET_SSH_HOST }}
13+
APP_GOOGLE_ANALYTICS_KEY: ${{ secrets.APP_DEVNET_GOOGLE_ANALYTICS_KEY }}
14+
steps:
15+
- name: Configure SSH
16+
run: |
17+
mkdir -p ~/.ssh/
18+
echo "$SSH_KEY" > ~/.ssh/devnet.key
19+
chmod 600 ~/.ssh/devnet.key
20+
21+
cat >>~/.ssh/config <<END
22+
Host injective-devnet
23+
HostName $SSH_HOST
24+
User $SSH_USER
25+
IdentityFile ~/.ssh/devnet.key
26+
StrictHostKeyChecking no
27+
END
28+
- name: Check out the source
29+
run: ssh injective-devnet 'cd ~/injective/injective-docs && git stash && git checkout dev -- && git pull origin dev'
30+
- name: Install Dependencies and generate module docs
31+
run: ssh injective-devnet 'export PATH=~/.nvm/versions/node/v16.15.0/bin/:$PATH && cd ~/injective/injective-docs && rm -rf node_modules && yarn install'
32+
- name: Build static site and copy the dist
33+
run: ssh injective-devnet 'export PATH=~/.nvm/versions/node/v16.15.0/bin/:$PATH && cd ~/injective/injective-docs && yarn build'

docs/develop/modules/core/auth/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This module is used in the Cosmos Hub.
3232

3333
## Concepts
3434

35-
**Note:** The auth module is different from the [authz module](../modules/authz/).
35+
**Note:** The auth module is different from the [authz module](../authz/).
3636

3737
The differences are:
3838

docs/develop/modules/core/authz/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ on behalf of one account to other accounts. The design is defined in the [ADR 03
3838
A *grant* is an allowance to execute a Msg by the grantee on behalf of the granter.
3939
Authorization is an interface that must be implemented by a concrete authorization logic to validate and execute grants. Authorizations are extensible and can be defined for any Msg service method even outside of the module where the Msg method is defined. See the `SendAuthorization` example in the next section for more details.
4040

41-
**Note:** The authz module is different from the [auth (authentication)](../modules/auth/) module that is responsible for specifying the base transaction and account types.
41+
**Note:** The authz module is different from the [auth (authentication)](../auth/) module that is responsible for specifying the base transaction and account types.
4242

4343
```go reference
4444
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/authz/authorizations.go#L11-L25

docs/develop/modules/core/index.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import {
2-
HomepageCard as Card,
3-
HomepageSection as Section,
2+
HomepageSection as Section
43
} from "../../../../src/components/HomepageComponents";
5-
import { DistributedIcon, CoreModulesIcon } from "../../../../src/icons";
64
import ComponentsGrid from "@theme/DocCardList";
75

86
# Core Modules

docusaurus.config.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const lightCodeTheme = require("prism-react-renderer/themes/github");
55
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
66
const math = require("remark-math");
77
const katex = require("rehype-katex");
8+
import "dotenv/config";
89

910
/** @type {import('@docusaurus/types').Config} */
1011
const config = {
@@ -19,7 +20,7 @@ const config = {
1920
// GitHub pages deployment config.
2021
// If you aren't using GitHub pages, you don't need these.
2122
organizationName: "Injective", // Usually your GitHub org/user name.
22-
projectName: "injective-core/docs", // Usually your repo name.
23+
projectName: "injective-docs", // Usually your repo name.
2324

2425
// Even if you don't use internalization, you can use this field to set useful
2526
// metadata like html lang. For example, if your site is Chinese, you may want
@@ -52,6 +53,9 @@ const config = {
5253
theme: {
5354
customCss: require.resolve("./src/css/custom.css"),
5455
},
56+
gtag: {
57+
trackingID: process.env.APP_GOOGLE_ANALYTICS_KEY,
58+
},
5559
}),
5660
],
5761
],
@@ -88,29 +92,29 @@ const config = {
8892
},
8993
items: [
9094
{
91-
to: '/learn',
92-
label: 'Learn',
93-
position: 'left',
95+
to: "/learn",
96+
label: "Learn",
97+
position: "left",
9498
},
9599
{
96-
to: '/develop',
97-
label: 'Develop',
98-
position: 'left',
100+
to: "/develop",
101+
label: "Develop",
102+
position: "left",
99103
},
100104
{
101-
to: '/trade',
102-
label: 'Trade',
103-
position: 'left',
105+
to: "/trade",
106+
label: "Trade",
107+
position: "left",
104108
},
105109
{
106-
to: '/nodes',
107-
label: 'Nodes & Validators',
108-
position: 'left',
110+
to: "/nodes",
111+
label: "Nodes & Validators",
112+
position: "left",
109113
},
110114
{
111-
to: '/resources',
112-
label: 'Resources',
113-
position: 'left',
115+
to: "/resources",
116+
label: "Resources",
117+
position: "left",
114118
},
115119
{
116120
href: "https://injective.com/",

scripts/setup.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,29 @@ cp $STUB_DIR/core_index.mdx.stub $CORE_DIR/index.mdx
3232
cp $STUB_DIR/injective_category.json.stub $INJECTIVE_DIR/_category_.json
3333
cp $STUB_DIR/injective_index.mdx.stub $INJECTIVE_DIR/index.mdx
3434

35+
## 1. Manually replace wrong import paths
36+
## authz
37+
search1="(../modules/auth/)"
38+
replace1="(../auth/)"
39+
40+
FILES=$( find $CORE_DIR/authz -type f )
41+
42+
for file in $FILES
43+
do
44+
sed -ie "s/${search1//\//\\/}/${replace1//\//\\/}/g" $file
45+
done
46+
47+
## auth
48+
search2="(../modules/authz/)"
49+
replace2="(../authz/)"
50+
51+
FILES=$( find $CORE_DIR/auth -type f )
52+
53+
for file in $FILES
54+
do
55+
sed -ie "s/${search2//\//\\/}/${replace2//\//\\/}/g" $file
56+
done
57+
58+
rm $CORE_DIR/authz/README.mde
59+
rm $CORE_DIR/auth/README.mde
3560
rm -rf $BUILD_DIR

0 commit comments

Comments
 (0)