Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: preview-build

on:
pull_request_target:
pull_request_target:
types:
- opened
- synchronize
Expand Down Expand Up @@ -34,7 +34,7 @@ permissions:

jobs:
build:
concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request_target' }}
runs-on: ubuntu-latest
Expand All @@ -46,14 +46,19 @@ jobs:
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
with:
files: ${{ inputs.path-pattern != '' && inputs.path-pattern || '**' }}


- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false

- name: Checkout
if: github.event_name == 'push' || steps.check-files.outputs.any_changed == 'true'
uses: actions/checkout@v4
with:
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
persist-credentials: false

- name: Create Deployment
if: github.event_name == 'push' || steps.check-files.outputs.any_changed == 'true'
uses: actions/github-script@v7
Expand Down Expand Up @@ -86,7 +91,7 @@ jobs:
log_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
})
return deployment.data.id

- name: Generate env.PATH_PREFIX
if: steps.deployment.outputs.result
env:
Expand All @@ -113,7 +118,7 @@ jobs:
- name: Bootstrap Action Workspace
if: github.repository == 'elastic/docs-builder' && steps.deployment.outputs.result
uses: ./.github/actions/bootstrap

# we run our artifact directly please use the prebuild
# elastic/docs-builder@main GitHub Action for all other repositories!
- name: Build documentation
Expand Down Expand Up @@ -142,7 +147,7 @@ jobs:
--paths "${PATH_PREFIX}" "${PATH_PREFIX}/*"

- name: Update Link Index
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.s3-upload.outcome == 'success'
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.s3-upload.outcome == 'success'
uses: elastic/docs-builder/actions/update-link-index@main

- name: Update deployment status
Expand Down
Loading