mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-02-18 04:01:08 -05:00
58 lines
2.0 KiB
YAML
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
|