-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (78 loc) · 2.62 KB
/
test-submodule-build.yml
File metadata and controls
87 lines (78 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Test Submodule Docs Build
# Reusable workflow called by provider submodule repos to validate that
# their docs changes still allow the shared docs hub to build successfully.
#
# Add the following as .github/workflows/test-docs-build.yaml in the provider repo.
# Use a separate file to avoid problems with exclusion of MD files.
#
# name: Test Docs Hub Build
#
# on:
# pull_request:
# paths:
# - 'docs/**'
# push:
# branches:
# - main
# paths:
# - 'docs/**'
#
# jobs:
# test-docs-hub-build-pr:
# if: github.event_name == 'pull_request'
# uses: SAP/crossplane-provider-docs/.github/workflows/test-submodule-build.yml@main
# with:
# provider-repo: ${{ github.event.pull_request.head.repo.full_name }}
# provider-ref: ${{ github.event.pull_request.head.sha }}
# submodule-path: docs/crossplane-provider-btp # adjust per provider
#
# test-docs-hub-build-push:
# if: github.event_name == 'push'
# uses: SAP/crossplane-provider-docs/.github/workflows/test-submodule-build.yml@main
# with:
# provider-repo: ${{ github.repository }}
# provider-ref: ${{ github.sha }}
# submodule-path: docs/crossplane-provider-btp # adjust per provider
on:
workflow_call:
inputs:
provider-repo:
description: "Full name of the provider repo, e.g. SAP/crossplane-provider-btp"
required: true
type: string
provider-ref:
description: "Git SHA of the provider commit to test"
required: true
type: string
submodule-path:
description: "Path of the submodule in crossplane-provider-docs, e.g. docs/crossplane-provider-btp"
required: true
type: string
jobs:
test-docs-build:
name: Test Docusaurus Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout crossplane-provider-docs
uses: actions/checkout@v4
with:
repository: SAP/crossplane-provider-docs
fetch-depth: 1
- name: Initialize all submodules at their pinned state
run: git submodule update --init
- name: Override target submodule with the commit under test
run: |
cd ${{ inputs.submodule-path }}
git fetch https://github.com/${{ inputs.provider-repo }}.git ${{ inputs.provider-ref }}
git checkout FETCH_HEAD
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build Docusaurus site
run: npm run build