Skip to content

Commit 27a5789

Browse files
committed
Merge branch 'main' into ecs-9.0
2 parents 9988a04 + beba787 commit 27a5789

File tree

208 files changed

+3905
-2500
lines changed

Some content is hidden

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

208 files changed

+3905
-2500
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@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
40+
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4.2.1
4141
with:
4242
role-to-assume: ${{ steps.role_arn.outputs.result }}
4343
aws-region: ${{ inputs.aws_region }}

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,10 @@ updates:
2424
interval: 'weekly'
2525
day: 'monday'
2626
time: '08:00'
27+
groups:
28+
system-io-abstractions:
29+
patterns:
30+
- 'System.IO.Abstractions'
31+
- 'System.IO.Abstractions.*'
2732
labels:
2833
- chore
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
# This workflow is used to build the link-index-updater
3+
# lambda function bootstrap binary that can be deployed to AWS Lambda.
4+
name: Build Link Index Updater Lambda
5+
6+
on:
7+
workflow_dispatch:
8+
workflow_call:
9+
inputs:
10+
ref:
11+
required: false
12+
type: string
13+
default: ${{ github.ref }}
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
env:
19+
BINARY_PATH: .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
ref: ${{ inputs.ref }}
24+
- name: Amazon Linux 2023 build
25+
run: |
26+
docker build . -t publish-links-index:latest -f src/infra/docs-lambda-index-publisher/lambda.DockerFile
27+
- name: Get bootstrap binary
28+
run: |
29+
docker cp $(docker create --name tc publish-links-index:latest):/app/.artifacts/publish ./.artifacts && docker rm tc
30+
- name: Inspect bootstrap binary
31+
run: |
32+
tree .artifacts
33+
stat "${BINARY_PATH}"
34+
- name: Archive artifact
35+
id: upload-artifact
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: link-index-updater-lambda-binary
39+
retention-days: 1
40+
if-no-files-found: error
41+
path: ${{ env.BINARY_PATH }}

.github/workflows/pr.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,11 @@ jobs:
2424
uses: ./.github/actions/bootstrap
2525

2626
- name: Build
27-
run: dotnet run --project src/docs-assembler -c release -- navigation validate
27+
run: dotnet run --project src/tooling/docs-assembler -c release -- navigation validate
2828

2929
build-lambda:
30-
runs-on: ubuntu-latest
31-
steps:
32-
- uses: actions/checkout@v4
33-
- name: Amazon Linux 2023 build
34-
run: |
35-
docker build . -t publish-links-index:latest -f src/infra/docs-lambda-index-publisher/lambda.DockerFile
36-
- name: Get bootstrap binary
37-
run: |
38-
docker cp $(docker create --name tc publish-links-index:latest):/app/.artifacts/publish ./.artifacts && docker rm tc
39-
tree .artifacts
40-
stat .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap
41-
30+
uses: ./.github/workflows/build-link-index-updater-lambda.yml
31+
4232
lint:
4333
runs-on: ubuntu-latest
4434
defaults:

.github/workflows/preview-build.yml

Lines changed: 81 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ on:
1010
branches:
1111
- main
1212
- master
13+
# TODO remove these need to be added to individual repositories
14+
- '\d+.\d+.\d+'
15+
- '\d+.\d+'
16+
- '\d+.x'
17+
tags:
18+
- 'v?\d+.\d+.\d+'
19+
- 'v?\d+.\d+'
1320
workflow_call:
1421
inputs:
1522
strict:
@@ -44,6 +51,41 @@ permissions:
4451
pull-requests: read
4552

4653
jobs:
54+
match:
55+
if: github.event.repository.fork == false # Skip running the job on the fork itself (It still runs on PRs on the upstream from forks)
56+
concurrency:
57+
group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref }}
58+
cancel-in-progress: ${{ startsWith(github.event_name, 'pull_request') }}
59+
runs-on: ubuntu-latest
60+
outputs:
61+
content-source-match: ${{ steps.event-check.outputs.content-source-match != '' && steps.event-check.outputs.content-source-match || steps.match.outputs.content-source-match }}
62+
content-source-next: ${{ steps.event-check.outputs.content-source-next != '' && steps.event-check.outputs.content-source-next || steps.match.outputs.content-source-next }}
63+
content-source-current: ${{ steps.event-check.outputs.content-source-current != '' && steps.event-check.outputs.content-source-current || steps.match.outputs.content-source-current }}
64+
steps:
65+
- name: Not a push event
66+
id: event-check
67+
if: contains(fromJSON('["merge_group", "pull_request", "pull_request_target"]'), github.event_name)
68+
# we always want to run for pull requests, but we do not want to indicate its either content source
69+
run: |
70+
echo "content-source-match=true" >> $GITHUB_OUTPUT
71+
echo "content-source-next=false" >> $GITHUB_OUTPUT
72+
echo "content-source-current=false" >> $GITHUB_OUTPUT
73+
- name: Match for push events
74+
id: match
75+
if: contains(fromJSON('["push"]'), github.event_name)
76+
uses: elastic/docs-builder/actions/assembler-match@main
77+
with:
78+
ref_name: ${{ github.ref_name }}
79+
repository: ${{ github.repository }}
80+
- name: Debug
81+
run: |
82+
echo "Non sensitive data, echo'ing here temporarily to validate this job before connecting it further into the build job"
83+
echo "content-source-match=${{ steps.event-check.outputs.content-source-match != '' && steps.event-check.outputs.content-source-match || steps.match.outputs.content-source-match }}"
84+
echo "content-source-name=${{ steps.event-check.outputs.content-source-next != '' && steps.event-check.outputs.content-source-next || steps.match.outputs.content-source-next }}"
85+
echo "content-source-current=${{ steps.event-check.outputs.content-source-current != '' && steps.event-check.outputs.content-source-current || steps.match.outputs.content-source-current }}"
86+
echo "ref=${{ github.ref_name }}"
87+
echo "repo=${{ github.repository }}"
88+
4789
build:
4890
if: github.event.repository.fork == false # Skip running the job on the fork itself (It still runs on PRs on the upstream from forks)
4991
concurrency:
@@ -52,30 +94,36 @@ jobs:
5294
runs-on: ubuntu-latest
5395
env:
5496
GITHUB_PR_REF_NAME: ${{ github.event.pull_request.head.ref }}
97+
MATCH: ${{ needs.match.outputs.content-source-match }}
98+
needs: [ match ]
5599
steps:
56100

57101
- name: Checkout
58-
if: contains(fromJSON('["push", "merge_group", "workflow_dispatch"]'), github.event_name)
102+
if: env.MATCH == 'true' && (contains(fromJSON('["push", "merge_group", "workflow_dispatch"]'), github.event_name))
59103
uses: actions/checkout@v4
60104
with:
61105
ref: ${{ github.event.pull_request.head.sha || github.ref }}
62106

63107
- name: Get changed files
64-
if: contains(fromJSON('["merge_group", "pull_request", "pull_request_target"]'), github.event_name)
108+
if: env.MATCH == 'true' && (contains(fromJSON('["merge_group", "pull_request", "pull_request_target"]'), github.event_name))
65109
id: check-files
66110
uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1
67111
with:
68112
files: ${{ inputs.path-pattern != '' && inputs.path-pattern || '**' }}
69113

70114
- name: Checkout
71-
if: startsWith(github.event_name, 'pull_request') && steps.check-files.outputs.any_modified == 'true'
115+
if: env.MATCH == 'true' && (startsWith(github.event_name, 'pull_request') && steps.check-files.outputs.any_modified == 'true')
72116
uses: actions/checkout@v4
73117
with:
74118
ref: ${{ github.event.pull_request.head.sha || github.ref }}
75119
persist-credentials: false
76120

77121
- name: Create Deployment
78-
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) || (steps.check-files.outputs.any_modified == 'true' && startsWith(github.event_name, 'pull_request'))
122+
if: |
123+
env.MATCH == 'true' &&
124+
(contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
125+
|| (steps.check-files.outputs.any_modified == 'true' && startsWith(github.event_name, 'pull_request'))
126+
)
79127
uses: actions/github-script@v7
80128
id: deployment
81129
env:
@@ -108,7 +156,7 @@ jobs:
108156
return deployment.data.id
109157
110158
- name: Generate env.PATH_PREFIX
111-
if: steps.deployment.outputs.result
159+
if: env.MATCH == 'true' && (steps.deployment.outputs.result)
112160
env:
113161
PR_NUMBER: ${{ github.event.pull_request.number }}
114162
GITHUB_REF_NAME: ${{ github.ref_name }}
@@ -119,10 +167,6 @@ jobs:
119167
;;
120168
"push" | "workflow_dispatch")
121169
echo "PATH_PREFIX=/${GITHUB_REPOSITORY}/tree/${GITHUB_REF_NAME}" >> $GITHUB_ENV
122-
if [[ ! "${GITHUB_REF_NAME}" =~ ^(main|master|16\.x)$ ]]; then
123-
echo "Unsupported ref name: '${GITHUB_REF_NAME}'";
124-
exit 1;
125-
fi
126170
;;
127171
*)
128172
echo "Unsupported event: '${GITHUB_EVENT_NAME}'";
@@ -131,18 +175,22 @@ jobs:
131175
esac
132176
133177
- name: Bootstrap Action Workspace
134-
if: github.repository == 'elastic/docs-builder' && steps.deployment.outputs.result
178+
if: env.MATCH == 'true' && (github.repository == 'elastic/docs-builder' && steps.deployment.outputs.result)
135179
uses: elastic/docs-builder/.github/actions/bootstrap@main
136180

137-
# we run our artifact directly please use the prebuild
181+
# we run our artifact directly, please use the prebuild
138182
# elastic/docs-builder@main GitHub Action for all other repositories!
139183
- name: Build documentation
140-
if: github.repository == 'elastic/docs-builder' && steps.deployment.outputs.result
184+
if: env.MATCH == 'true' && (github.repository == 'elastic/docs-builder' && steps.deployment.outputs.result)
141185
run: |
142-
dotnet run --project src/docs-builder -- --strict --path-prefix "${PATH_PREFIX}"
186+
dotnet run --project src/tooling/docs-builder -- --strict --path-prefix "${PATH_PREFIX}"
143187
144188
- name: Build documentation
145-
if: github.repository != 'elastic/docs-builder' && (steps.deployment.outputs.result || (steps.check-files.outputs.any_modified == 'true' && github.event_name == 'merge_group'))
189+
if: |
190+
env.MATCH == 'true' &&
191+
(github.repository != 'elastic/docs-builder' &&
192+
(steps.deployment.outputs.result || (steps.check-files.outputs.any_modified == 'true' && github.event_name == 'merge_group'))
193+
)
146194
uses: elastic/docs-builder@main
147195
id: docs-build
148196
continue-on-error: ${{ fromJSON(inputs.continue-on-error != '' && inputs.continue-on-error || 'false') }}
@@ -152,36 +200,46 @@ jobs:
152200
metadata-only: ${{ fromJSON(inputs.metadata-only != '' && inputs.metadata-only || 'true') }}
153201

154202
- name: 'Validate inbound links'
155-
if: ${{ !cancelled() && steps.docs-build.outputs.skip != 'true' && (steps.deployment.outputs.result || (steps.check-files.outputs.any_modified == 'true' && github.event_name == 'merge_group')) }}
203+
if: |
204+
env.MATCH == 'true' &&
205+
(!cancelled() && steps.docs-build.outputs.skip != 'true'
206+
&& (steps.deployment.outputs.result || (steps.check-files.outputs.any_modified == 'true' && github.event_name == 'merge_group'))
207+
)
156208
uses: elastic/docs-builder/actions/validate-inbound-local@main
157209

158210
- name: 'Validate local path prefixes against those claimed by global navigation.yml'
159-
if: ${{ !cancelled() && steps.docs-build.outputs.skip != 'true' && (steps.deployment.outputs.result || (steps.check-files.outputs.any_modified == 'true' && github.event_name == 'merge_group')) }}
211+
if: |
212+
env.MATCH == 'true' &&
213+
(!cancelled() && steps.docs-build.outputs.skip != 'true' &&
214+
(steps.deployment.outputs.result || (steps.check-files.outputs.any_modified == 'true' && github.event_name == 'merge_group'))
215+
)
160216
uses: elastic/docs-builder/actions/validate-path-prefixes-local@main
161217

162218
- uses: elastic/docs-builder/.github/actions/aws-auth@main
163219
if: ${{ !cancelled() && steps.docs-build.outputs.skip != 'true' && steps.deployment.outputs.result }}
164220

165221
- name: Upload to S3
166222
id: s3-upload
167-
if: ${{ !cancelled() && steps.docs-build.outputs.skip != 'true' && steps.deployment.outputs.result }}
223+
if: |
224+
env.MATCH == 'true' &&
225+
(!cancelled() && steps.docs-build.outputs.skip != 'true' && steps.deployment.outputs.result)
168226
run: |
169227
aws s3 sync .artifacts/docs/html "s3://elastic-docs-v3-website-preview${PATH_PREFIX}" --delete --no-follow-symlinks
170228
aws cloudfront create-invalidation \
171229
--distribution-id EKT7LT5PM8RKS \
172230
--paths "${PATH_PREFIX}" "${PATH_PREFIX}/*"
173231
174232
- name: Update Link Index
175-
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && steps.s3-upload.outcome == 'success'
233+
if: |
234+
env.MATCH == 'true' &&
235+
(contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
236+
&& (needs.match.outputs.content-source-current == 'true' || needs.match.outputs.content-source-next == 'true')
237+
&& steps.s3-upload.outcome == 'success')
176238
uses: elastic/docs-builder/actions/update-link-index@main
177239

178-
- name: Update Reference Index
179-
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && steps.s3-upload.outcome == 'success'
180-
uses: elastic/docs-builder/actions/update-reference-index@main
181-
182240
- name: Update deployment status
183241
uses: actions/github-script@v7
184-
if: always() && steps.deployment.outputs.result
242+
if: env.MATCH == 'true' && (always() && steps.deployment.outputs.result)
185243
env:
186244
PR_NUMBER: ${{ github.event.pull_request.number }}
187245
LANDING_PAGE_PATH: ${{ steps.docs-build.outputs.landing-page-path || env.PATH_PREFIX }}

.github/workflows/preview-cleanup.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,3 @@ jobs:
5252
PR_NUMBER: ${{ github.event.pull_request.number }}
5353
run: |
5454
aws s3 rm "s3://elastic-docs-v3-website-preview/${GITHUB_REPOSITORY}/pull/${PR_NUMBER}" --recursive
55-
56-
- name: 'Update Reference Index'
57-
uses: elastic/docs-builder/actions/update-reference-index@main

0 commit comments

Comments
 (0)