Skip to content

Commit ecbfce5

Browse files
Merge branch 'main' into add-fleet-server-elastic-agent
2 parents 17faa18 + 4295de9 commit ecbfce5

File tree

65 files changed

+1021
-500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1021
-500
lines changed

.github/actions/aws-auth/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ runs:
3737
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
3838
f.write(f"result=arn:aws:iam::{os.environ["AWS_ACCOUNT_ID"]}:role/{prefix}{hash}")
3939
- name: Configure AWS Credentials
40-
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
40+
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
4141
with:
4242
role-to-assume: ${{ steps.role_arn.outputs.result }}
4343
aws-region: ${{ inputs.aws_region }}

.github/actions/bootstrap/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ runs:
3838
echo "full-version=${REPO_VERSION}" >> $GITHUB_OUTPUT
3939
echo "major-version=$(echo ${REPO_VERSION} | cut -d"." -f1)" >> $GITHUB_OUTPUT
4040
41-
- uses: actions/setup-node@v4
41+
- uses: actions/setup-node@v5
4242
with:
4343
cache: npm
4444
cache-dependency-path: src/Elastic.Documentation.Site/package-lock.json
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Auto-add triage label
3+
4+
on:
5+
issues:
6+
types:
7+
- opened
8+
9+
permissions:
10+
contents: read
11+
issues: write
12+
13+
jobs:
14+
add-triage-label:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Add needs triage label
18+
uses: actions/github-script@v7
19+
with:
20+
script: |
21+
github.rest.issues.addLabels({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
issue_number: context.issue.number,
25+
labels: ['needs triage']
26+
})

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
steps:
4747
- uses: actions/checkout@v5
4848

49-
- uses: actions/setup-node@v4
49+
- uses: actions/setup-node@v5
5050
with:
5151
cache: npm
5252
cache-dependency-path: src/Elastic.Documentation.Site/package-lock.json
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Deploy API Lambda (edge)"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
deploy:
13+
uses: ./.github/workflows/deploy-api-lambda.yml
14+
permissions:
15+
id-token: write
16+
contents: read
17+
with:
18+
environment: edge
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Deploy API Lambda (prod)"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: 'The git tag of the release to deploy, e.g. 3.0.0'
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
deploy:
16+
uses: ./.github/workflows/deploy-api-lambda.yml
17+
permissions:
18+
id-token: write
19+
contents: read
20+
with:
21+
environment: prod
22+
ref: refs/tags/${{ github.event.inputs.ref }}
Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
name: Deploy API Lambda
2+
23
on:
3-
push:
4-
branches:
5-
- main
6-
workflow_dispatch:
4+
workflow_call:
5+
inputs:
6+
environment:
7+
required: true
8+
type: string
9+
description: edge, staging or prod
10+
ref:
11+
required: false
12+
type: string
13+
default: ${{ github.ref }}
714

815
permissions:
916
contents: read
@@ -13,23 +20,21 @@ jobs:
1320
permissions:
1421
contents: read
1522
uses: ./.github/workflows/build-api-lambda.yml
16-
23+
with:
24+
ref: ${{ inputs.ref }}
25+
1726
deploy:
18-
concurrency: ${{ github.workflow }}
27+
concurrency: ${{ github.workflow }}-${{ inputs.environment }}
1928
permissions:
2029
contents: read
2130
id-token: write
2231
runs-on: ubuntu-latest
2332
needs: build
24-
environment: docs-api-edge
33+
environment: docs-api-${{ inputs.environment }}
2534
env:
2635
ZIP_FILE: api-lambda.zip
2736
steps:
2837
- uses: actions/checkout@v5
29-
- name: Download bootstrap binary
30-
uses: actions/download-artifact@v4
31-
with:
32-
name: api-lambda-binary
3338

3439
- name: Download bootstrap binary
3540
uses: actions/download-artifact@v4
@@ -40,13 +45,24 @@ jobs:
4045
run: |
4146
zip -j "${ZIP_FILE}" ./bootstrap
4247
43-
- uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
48+
- uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
4449
with:
45-
role-to-assume: arn:aws:iam::197730964718:role/elastic-docs-v3-api-deployer-edge
50+
role-to-assume: arn:aws:iam::197730964718:role/elastic-docs-v3-api-deployer-${{ inputs.environment }}
4651
aws-region: us-east-1
4752

4853
- name: Upload Lambda function
4954
run: |
50-
aws lambda update-function-code \
51-
--function-name elastic-docs-v3-edge-api \
52-
--zip-file "fileb://${ZIP_FILE}"
55+
NEW_VERSION=$(aws lambda update-function-code \
56+
--function-name "elastic-docs-v3-${ENVIRONMENT}-api" \
57+
--zip-file "fileb://${ZIP_FILE}" \
58+
--publish \
59+
--query 'Version' \
60+
--output text)
61+
62+
aws lambda update-alias \
63+
--function-name "elastic-docs-v3-${ENVIRONMENT}-api" \
64+
--name live \
65+
--function-version $NEW_VERSION
66+
67+
env:
68+
ENVIRONMENT: ${{ inputs.environment }}

.github/workflows/preview-build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ jobs:
367367
env.MATCH == 'true'
368368
&& (
369369
!cancelled()
370+
&& github.repository != 'elastic/docs-builder'
370371
&& steps.docs-build.outputs.skip != 'true'
371372
&& (
372373
steps.deployment.outputs.result
@@ -377,12 +378,31 @@ jobs:
377378
)
378379
)
379380
uses: elastic/docs-builder/actions/validate-inbound-local@main
381+
382+
- name: 'Validate inbound links'
383+
if: >
384+
env.MATCH == 'true'
385+
&& (
386+
!cancelled()
387+
&& github.repository == 'elastic/docs-builder'
388+
&& steps.docs-build.outputs.skip != 'true'
389+
&& (
390+
steps.deployment.outputs.result
391+
|| (
392+
needs.check.outputs.any_modified == 'true'
393+
&& github.event_name == 'merge_group'
394+
)
395+
)
396+
)
397+
run: |
398+
dotnet run --project src/tooling/docs-builder -- inbound-links validate-link-reference
380399
381400
- name: 'Validate local path prefixes against those claimed by global navigation.yml'
382401
if: >
383402
env.MATCH == 'true'
384403
&& (
385404
!cancelled()
405+
&& github.repository != 'elastic/docs-builder'
386406
&& steps.docs-build.outputs.skip != 'true'
387407
&& (
388408
steps.deployment.outputs.result
@@ -393,6 +413,24 @@ jobs:
393413
)
394414
)
395415
uses: elastic/docs-builder/actions/validate-path-prefixes-local@main
416+
417+
- name: 'Validate local path prefixes against those claimed by global navigation.yml'
418+
if: >
419+
env.MATCH == 'true'
420+
&& (
421+
!cancelled()
422+
&& github.repository == 'elastic/docs-builder'
423+
&& steps.docs-build.outputs.skip != 'true'
424+
&& (
425+
steps.deployment.outputs.result
426+
|| (
427+
needs.check.outputs.any_modified == 'true'
428+
&& github.event_name == 'merge_group'
429+
)
430+
)
431+
)
432+
run: |
433+
dotnet run --project src/tooling/docs-assembler -- navigation validate-link-reference
396434
397435
- uses: elastic/docs-builder/.github/actions/aws-auth@main
398436
if: >

.github/workflows/release.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,19 @@ jobs:
7575
uses: ./.github/workflows/build-link-index-updater-lambda.yml
7676
with:
7777
ref: ${{ needs.release-drafter.outputs.tag_name }}
78+
79+
deploy-api-lambda-staging:
80+
needs:
81+
- release-drafter
82+
uses: ./.github/workflows/deploy-api-lambda.yml
83+
permissions:
84+
id-token: write
85+
contents: read
86+
with:
87+
environment: staging
88+
ref: refs/tags/${{ needs.release-drafter.outputs.tag_name }}
7889

79-
release-lambda:
90+
deploy-link-index-updater-lambda-prod:
8091
environment:
8192
name: link-index-updater-prod
8293
runs-on: ubuntu-latest
@@ -99,7 +110,7 @@ jobs:
99110
run: |
100111
zip -j "${ZIP_FILE}" ./bootstrap
101112
102-
- uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
113+
- uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
103114
with:
104115
role-to-assume: arn:aws:iam::197730964718:role/elastic-docs-v3-link-index-updater-deployer
105116
aws-region: us-east-2
@@ -163,8 +174,9 @@ jobs:
163174
publish-release:
164175
needs:
165176
- release
166-
- release-lambda
167177
- release-drafter
178+
- deploy-api-lambda-staging
179+
- deploy-link-index-updater-lambda-prod
168180
runs-on: ubuntu-latest
169181
permissions:
170182
contents: write

actions/update-link-index/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ runs:
4242
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
4343
f.write(f"result=arn:aws:iam::{aws_account_id}:role/{prefix}{hash}")
4444
- name: Configure AWS Credentials
45-
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
45+
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
4646
with:
4747
role-to-assume: ${{ steps.role_arn.outputs.result }}
4848
aws-region: us-east-1

0 commit comments

Comments
 (0)