Skip to content

Commit

Permalink
Move main repo to a submodule to enable live editing (#214)
Browse files Browse the repository at this point in the history
Signed-off-by: Janos Bonic <[email protected]>
  • Loading branch information
Janos authored Nov 28, 2023
1 parent 60dfe73 commit 2105bae
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Setup Node
uses: actions/setup-node@v3
with:
Expand All @@ -24,8 +26,6 @@ jobs:
run: npm ci
- name: Lint code
run: npm run lint
- name: Fetch docs
run: make
- name: Build website
run: npm run build
- name: Publish to Cloudflare Pages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Setup Node
uses: actions/setup-node@v3
with:
Expand All @@ -33,8 +35,6 @@ jobs:
run: npm ci
- name: Lint code
run: npm run lint
- name: Fetch docs
run: make
- name: Build website
run: npm run build
- name: Setup Pages
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
.env.test.local
.env.production.local
.eslintcache
.idea

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

/opentofu-repo
/docs/**
!/docs/index.mdx
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "opentofu-repo"]
path = opentofu-repo
url = https://github.com/opentofu/opentofu
branch = main
26 changes: 0 additions & 26 deletions Makefile

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ npm i
3. Fetch the documentation

```bash
make
git submodule init
git submodule update
```

4. Start the development server
Expand Down
3 changes: 2 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,13 @@ const config = {
},
docs: {
sidebarPath: require.resolve("./sidebars.js"),
path: "opentofu-repo/website/docs",
routeBasePath: "/docs",
editUrl: ({ docPath }) => {
// Remove the edit link from the documentation index page
// TODO: remove after moving the page to the main OpenTofu repo
if (docPath === "index.mdx") {
return undefined;
return `https://github.com/opentofu/opentofu.org/edit/main/docs/${docPath}`;
}

return `https://github.com/opentofu/opentofu/edit/main/website/docs/${docPath}`;
Expand Down
1 change: 1 addition & 0 deletions opentofu-repo
Submodule opentofu-repo added at 5d4ae4

0 comments on commit 2105bae

Please sign in to comment.