|
| 1 | +# Content sources |
| 2 | + |
| 3 | +To support multiple branching strategies for different repositories, we support the concept of a content source. |
| 4 | + |
| 5 | +Next |
| 6 | +: The source for the upcoming documentation. |
| 7 | + |
| 8 | +Current |
| 9 | +: The source for the active documentation. |
| 10 | + |
| 11 | + |
| 12 | +Our publish environments are connected to a single content source. |
| 13 | + |
| 14 | +| Publish Environment | Content Source | |
| 15 | +|---------------------|----------------| |
| 16 | +| Production | `Current` | |
| 17 | +| Staging | `Current` | |
| 18 | +| Edge | `Next` | |
| 19 | + |
| 20 | +This allows you as an owner of a repository to choose two different branching strategies. |
| 21 | + |
| 22 | +## Branching strategies |
| 23 | + |
| 24 | +The new documentation system supports 2 branching strategies. |
| 25 | + |
| 26 | +Continuous deployment |
| 27 | +: This is the default where a repositories `main` or `master` branch is continuously deployed to production. |
| 28 | + |
| 29 | +Tagged |
| 30 | +: Allows you to 'tag' a single git reference (typically a branch) as `current` which will be used to deploy to production. |
| 31 | + Allowing you to control the timing of when new documentation should go live. |
| 32 | + |
| 33 | + |
| 34 | +### Continuous deployment |
| 35 | + |
| 36 | +This is the default. To get started, follow our [guide](/migration/guide/index.md) to set up the new docs folder structure and CI configuration. |
| 37 | + |
| 38 | +Once setup ensure the repository is added to our `assembler.yml` under `references`. |
| 39 | + |
| 40 | +For example say you want to onboard `elastic/my-repository` into the production build: |
| 41 | + |
| 42 | +```yaml |
| 43 | +references: |
| 44 | + my-repository: |
| 45 | +``` |
| 46 | +
|
| 47 | +Is equivalent to specifying. |
| 48 | +
|
| 49 | +```yaml |
| 50 | +references: |
| 51 | + my-repository: |
| 52 | + next: main |
| 53 | + current: main |
| 54 | +``` |
| 55 | +
|
| 56 | +% TODO we need navigation.yml docs |
| 57 | +Once the repository is added, its navigation still needs to be injected into to global site navigation. |
| 58 | +
|
| 59 | +### Tagged |
| 60 | +
|
| 61 | +If you want to have more control over the timing of when your docs go live to production. Configure the repository |
| 62 | +in our `assembler.yml` to have a fixed git reference (typically a branch) deploy the `current` content source to production. |
| 63 | + |
| 64 | +```yaml |
| 65 | +references: |
| 66 | + my-other-repository: |
| 67 | + next: main |
| 68 | + current: 9.0 |
| 69 | +``` |
| 70 | + |
| 71 | +:::{note} |
| 72 | +In order for `9.0` to be onboarded it needs to first follow our [migration guide](/migration/guide/index.md) and have our documentation CI integration setup. |
| 73 | +Our CI integration checks will block until `current` is successfully configured |
| 74 | +::: |
| 75 | + |
| 76 | +#### CI configuration |
| 77 | + |
| 78 | +To ensure repositories that use the [tagged branching strategy](#tagged) can be onboarded correctly, our CI integration needs to have appropriate `push` |
| 79 | + branch triggers. |
| 80 | + |
| 81 | +```yml |
| 82 | +name: docs-build |
| 83 | +
|
| 84 | +on: |
| 85 | + push: |
| 86 | + branches: |
| 87 | + - main |
| 88 | + - '\d+.\d+' <1> |
| 89 | + pull_request_target: ~ |
| 90 | + merge_group: ~ |
| 91 | +
|
| 92 | +jobs: |
| 93 | + docs-preview: |
| 94 | + uses: elastic/docs-builder/.github/workflows/preview-build.yml@main |
| 95 | + with: |
| 96 | + path-pattern: docs/** |
| 97 | + permissions: |
| 98 | + deployments: write |
| 99 | + id-token: write |
| 100 | + contents: read |
| 101 | + pull-requests: write |
| 102 | +``` |
| 103 | + |
| 104 | +1. Ensure version branches are built and publish their links ahead of time. |
0 commit comments