Skip to content

Commit

Permalink
chore: gh workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bangjelkoski committed Oct 7, 2024
1 parent 7c8230a commit 249fbc5
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 21 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Injective Chain canonical docs deployment
on:
push:
branches: [dev]

jobs:
release:
runs-on: self-hosted
env:
SSH_USER: ${{ secrets.DEVNET_SSH_USER }}
SSH_KEY: ${{ secrets.DEVNET_SSH_KEY }}
SSH_HOST: ${{ secrets.DEVNET_SSH_HOST }}
APP_GOOGLE_ANALYTICS_KEY: ${{ secrets.APP_DEVNET_GOOGLE_ANALYTICS_KEY }}
steps:
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/devnet.key
chmod 600 ~/.ssh/devnet.key
cat >>~/.ssh/config <<END
Host injective-devnet
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/devnet.key
StrictHostKeyChecking no
END
- name: Check out the source
run: ssh injective-devnet 'cd ~/injective/injective-docs && git stash && git checkout dev -- && git pull origin dev'
- name: Install Dependencies and generate module docs
run: ssh injective-devnet 'export PATH=~/.nvm/versions/node/v16.15.0/bin/:$PATH && cd ~/injective/injective-docs && rm -rf node_modules && yarn install'
- name: Build static site and copy the dist
run: ssh injective-devnet 'export PATH=~/.nvm/versions/node/v16.15.0/bin/:$PATH && cd ~/injective/injective-docs && yarn build'
2 changes: 1 addition & 1 deletion docs/develop/modules/core/auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This module is used in the Cosmos Hub.

## Concepts

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

The differences are:

Expand Down
2 changes: 1 addition & 1 deletion docs/develop/modules/core/authz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ on behalf of one account to other accounts. The design is defined in the [ADR 03
A *grant* is an allowance to execute a Msg by the grantee on behalf of the granter.
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.

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

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/authz/authorizations.go#L11-L25
Expand Down
4 changes: 1 addition & 3 deletions docs/develop/modules/core/index.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {
HomepageCard as Card,
HomepageSection as Section,
HomepageSection as Section
} from "../../../../src/components/HomepageComponents";
import { DistributedIcon, CoreModulesIcon } from "../../../../src/icons";
import ComponentsGrid from "@theme/DocCardList";

# Core Modules
Expand Down
36 changes: 20 additions & 16 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
const math = require("remark-math");
const katex = require("rehype-katex");
import "dotenv/config";

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

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
Expand Down Expand Up @@ -52,6 +53,9 @@ const config = {
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
gtag: {
trackingID: process.env.APP_GOOGLE_ANALYTICS_KEY,
},
}),
],
],
Expand Down Expand Up @@ -88,29 +92,29 @@ const config = {
},
items: [
{
to: '/learn',
label: 'Learn',
position: 'left',
to: "/learn",
label: "Learn",
position: "left",
},
{
to: '/develop',
label: 'Develop',
position: 'left',
to: "/develop",
label: "Develop",
position: "left",
},
{
to: '/trade',
label: 'Trade',
position: 'left',
to: "/trade",
label: "Trade",
position: "left",
},
{
to: '/nodes',
label: 'Nodes & Validators',
position: 'left',
to: "/nodes",
label: "Nodes & Validators",
position: "left",
},
{
to: '/resources',
label: 'Resources',
position: 'left',
to: "/resources",
label: "Resources",
position: "left",
},
{
href: "https://injective.com/",
Expand Down
25 changes: 25 additions & 0 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,29 @@ cp $STUB_DIR/core_index.mdx.stub $CORE_DIR/index.mdx
cp $STUB_DIR/injective_category.json.stub $INJECTIVE_DIR/_category_.json
cp $STUB_DIR/injective_index.mdx.stub $INJECTIVE_DIR/index.mdx

## 1. Manually replace wrong import paths
## authz
search1="(../modules/auth/)"
replace1="(../auth/)"

FILES=$( find $CORE_DIR/authz -type f )

for file in $FILES
do
sed -ie "s/${search1//\//\\/}/${replace1//\//\\/}/g" $file
done

## auth
search2="(../modules/authz/)"
replace2="(../authz/)"

FILES=$( find $CORE_DIR/auth -type f )

for file in $FILES
do
sed -ie "s/${search2//\//\\/}/${replace2//\//\\/}/g" $file
done

rm $CORE_DIR/authz/README.mde
rm $CORE_DIR/auth/README.mde
rm -rf $BUILD_DIR

0 comments on commit 249fbc5

Please sign in to comment.