1
0
mirror of synced 2025-12-30 03:02:21 -05:00
Files
airbyte/.github/workflows/docs-build.yml
2025-06-23 19:18:54 +00:00

82 lines
2.5 KiB
YAML

# This workflow builds the documentation for the project using `poe` and `uv`.
# It is redundant with the Vercel Preview deployment, but is runs unprivileged and
# can be used on forks to verify the documentation build without deploying it.
name: Docusaurus
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
detect-changes:
name: Detect Changes
runs-on: ubuntu-24.04
steps:
# Checkout not required from `pull_request` event.
# The detection method uses the GitHub REST API.
- name: Detect Changes
id: detect-changes
uses: dorny/paths-filter@v3.0.2
with:
filters: |
docs:
- 'docs/**'
- 'docusaurus/**'
- '.markdownlint.jsonc'
outputs:
# 'true' if any of the docs files have changed, 'false' otherwise.
changed: ${{ steps.detect-changes.outputs.docs }}
build-docs:
name: Build Airbyte Docs
runs-on: ubuntu-24.04
needs: detect-changes
if: needs.detect-changes.outputs.changed == 'true'
steps:
- name: Checkout Current Branch
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: Check For Skip Conditions
id: check-skip
run: |
# temporarily disable -e so we can capture a non-zero exit
set +e
# Run the script and capture the exit code.
./docs/check-docs-git-diff.sh
exit_code=$?
set -e
if [ $exit_code -eq 0 ]; then
echo "✅ Documentation already up-to-date. No build required."
echo skip-build=true | tee -a $GITHUB_OUTPUT
else
echo "❌ Documentation needs to be built."
echo skip-build=false | tee -a $GITHUB_OUTPUT
fi
- name: Set Up pnpm
if: steps.check-skip.outputs.skip-build != 'true'
# pnpm is used to manage the dependencies of the documentation build.
uses: pnpm/action-setup@v4
with:
version: 10.12.1
- name: Install uv
if: steps.check-skip.outputs.skip-build != 'true'
uses: astral-sh/setup-uv@v6
- name: Install Poe
if: steps.check-skip.outputs.skip-build != 'true'
run: |
# Install Poe so we can run the connector tasks:
uv tool install poethepoet
- name: Build Docs
if: steps.check-skip.outputs.skip-build != 'true'
run: |
poe docs-build