Skip to content

Commit 1acb9d9

Browse files
committed
refactor
1 parent c7df24a commit 1acb9d9

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

.github/workflows/pr.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
permissions:
77
contents: read
88
packages: read
9+
id-token: write
10+
pull-requests: write
11+
deployments: write
912

1013
concurrency:
1114
group: ${{ github.workflow }}-${{ github.ref }}
@@ -36,4 +39,12 @@ jobs:
3639
# we run our artifact directly please use the prebuild
3740
# elastic/docs-builder@main GitHub Action for all other repositories!
3841
- name: Build documentation
39-
run: .artifacts/publish/docs-builder/release/docs-builder --strict
42+
run: .artifacts/publish/docs-builder/release/docs-builder --strict --path-prefix "/${GITHUB_REPOSITORY}/pull/${PR_NUMBER}"
43+
44+
- uses: actions/upload-artifact@v4
45+
with:
46+
name: html
47+
path: .artifacts/docs/html/
48+
49+
preview:
50+
uses: ./.github/workflows/preview.yml

.github/workflows/preview.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: preview
22

33
on:
4-
pull_request: ~
4+
workflow_call: ~
55

66
permissions:
77
contents: read
@@ -10,9 +10,6 @@ permissions:
1010
pull-requests: write
1111
deployments: write
1212

13-
env:
14-
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
15-
1613
jobs:
1714
build:
1815
runs-on: ubuntu-latest
@@ -46,19 +43,10 @@ jobs:
4643
4744
return response.data.id
4845
49-
- uses: actions/checkout@v4
50-
51-
- name: Bootstrap Action Workspace
52-
id: bootstrap
53-
uses: ./.github/actions/bootstrap
54-
55-
- name: Publish AOT
56-
run: ./build.sh publishbinaries
46+
- uses: actions/download-artifact@v4
47+
with:
48+
name: html
5749

58-
- name: Build documentation
59-
env:
60-
PR_NUMBER: ${{ github.event.pull_request.number }}
61-
run: .artifacts/publish/docs-builder/release/docs-builder --strict --path-prefix "/${GITHUB_REPOSITORY}/pull/${PR_NUMBER}"
6250
- name: Generate ARNs
6351
id: generate_arns
6452
shell: python
@@ -87,10 +75,9 @@ jobs:
8775
env:
8876
PR_NUMBER: ${{ github.event.pull_request.number }}
8977
run: |
90-
aws s3 sync .artifacts/docs/html "s3://elastic-docs-v3-website-preview/${GITHUB_REPOSITORY}/pull/${PR_NUMBER}" --delete
78+
aws s3 sync . "s3://elastic-docs-v3-website-preview/${GITHUB_REPOSITORY}/pull/${PR_NUMBER}" --delete
9179
aws cloudfront create-invalidation --distribution-id EKT7LT5PM8RKS --paths "/${GITHUB_REPOSITORY}/pull/${PR_NUMBER}/*"
9280
93-
9481
- name: Update deployment status
9582
uses: actions/github-script@v7
9683
if: steps.deployment.outputs.result

0 commit comments

Comments
 (0)