Files
opentf/.github/workflows/website.yml
Christian Mesh 531ade9d35 Skip unnessary workflow checks (#2872)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-05-28 11:30:06 -04:00

58 lines
2.0 KiB
YAML

name: Website checks
on:
pull_request:
push:
branches:
- main
- 'v[0-9]+.[0-9]+'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
fileschanged:
name: List files changed for pull request
runs-on: ubuntu-latest
steps:
- name: "Fetch source code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- id: diff
run: |
echo "Comparing current commit to base ref origin/${{github.event.pull_request.base.ref}}"
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin ${{github.event.pull_request.base.ref}}
echo "install=$(git diff --name-only origin/${{github.event.pull_request.base.ref}} | grep 'website/docs/intro/install' | wc -l)" | tee -a "$GITHUB_OUTPUT"
echo "website=$(git diff --name-only origin/${{github.event.pull_request.base.ref}} | grep 'website/' | wc -l)" | tee -a "$GITHUB_OUTPUT"
outputs:
install: ${{ steps.diff.outputs.install }}
website: ${{ steps.diff.outputs.website }}
build:
name: Build
runs-on: ubuntu-latest
needs: fileschanged
if: ${{ needs.fileschanged.outputs.website != 0}}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Prepare website container
run: docker compose -f docker-compose.build.yml build
working-directory: website
- name: Build website
run: docker compose -f docker-compose.build.yml up --exit-code-from website
working-directory: website
installation-instructions:
name: "Test Installation Instructions"
runs-on: ubuntu-latest
needs: fileschanged
if: ${{ needs.fileschanged.outputs.install != 0}}
steps:
- name: "Fetch source code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: "Run Installation Instructions Test"
run: make test-linux-install-instructions