Skip to content

Commit 5059f86

Browse files
authored
Add add-repo doc (#1443)
* Add add-repo doc * Edits
1 parent 2e4796a commit 5059f86

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

docs/_docset.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ toc:
3131
- file: on-the-web.md
3232
- file: move.md
3333
- file: redirects.md
34+
- file: add-repo.md
3435
- folder: migration
3536
children:
3637
- file: index.md

docs/contribute/add-repo.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Add a new repository to the docs
2+
3+
Elastic documentation is built from many assembled repositories using `docs-assembler`. Adding a new repository requires making the assembly process aware of its existence.
4+
5+
Follow these instructions to add a new docs repository.
6+
7+
## Prerequisites
8+
9+
The new docs repository needs to satisfy these requirements:
10+
11+
- The repository must have a `docs` folder in the root.
12+
- The `docs` folder must contain a valid [`docset.yml` file](../configure/content-set/navigation.md) and Markdown files.
13+
- Markdown files within the `docs` folder that follow the V3 format. Refer to [Syntax](../syntax/index.md).
14+
- The repository must be within the Elastic organization on `GitHub` and public.
15+
16+
## Add the repository
17+
18+
Follow these instructions to add a new repository to the docs.
19+
20+
:::::{stepper}
21+
22+
::::{step} Add the repo to docs-infra
23+
24+
Add the repo to the list of repositories that can upload to the Link index by editing the [repositories.yml](https://github.com/elastic/docs-infra/blob/main/modules/aws-github-actions-oidc-roles/repositories.yml) file.
25+
26+
For example, to add the fictitious `elastic/yadda-docs` repository:
27+
28+
```yaml
29+
repositories:
30+
- name: elastic/yadda-docs # Added for testing purposes
31+
```
32+
33+
::::
34+
35+
::::{step} Add the workflow actions to the repository
36+
37+
Add the following actions to the `.github/workflows` directory of your repo:
38+
39+
- https://github.com/elastic/docs-builder/blob/main/.github%2Fworkflows%2Fpreview-build.yml
40+
- https://github.com/elastic/docs-builder/blob/main/.github/workflows/preview-cleanup.yml
41+
42+
Then, successfully run a docs build on the `main` branch. This is a requirement. For example, you can merge a docs pull request to `main` after adding the workflow actions.
43+
44+
::::
45+
46+
::::{step} Add the repository to the assembler and navigation configs
47+
48+
Edit the [assembler.yml](https://github.com/elastic/docs-builder/blob/main/src/tooling/docs-assembler/assembler.yml) file to add the repository. Refer to [assembler.yml](../configure/site/content.md) for more information.
49+
50+
For example, to add the `elastic/yadda-docs` repository:
51+
52+
```yaml
53+
references:
54+
yadda-docs:
55+
```
56+
57+
Then, edit the [navigation.yml](https://github.com/elastic/docs-builder/blob/main/src/tooling/docs-assembler/navigation.yml) file to add the repository to the navigation.
58+
59+
For example, to add the `elastic/yadda-docs` repository under **Reference**:
60+
61+
```yaml
62+
#############
63+
# REFERENCE #
64+
#############
65+
- toc: reference
66+
path_prefix: reference
67+
children:
68+
# Yadda
69+
# ✅ https://github.com/elastic/yadda-docs/blob/main/docs/toc.yml
70+
- toc: yadda-docs://
71+
path_prefix: reference/yadda
72+
```
73+
74+
::::
75+
:::::
76+
77+
## Add .artifacts to .gitignore
78+
79+
For a more comfortable local `docs-builder` experience, add the following line to the `.gitignore` file of the repo:
80+
81+
```
82+
docs/.artifacts
83+
```

0 commit comments

Comments
 (0)