|
| 1 | +# Reusable GitHub Action to build the documentation for a given repository. |
| 2 | + |
| 3 | +name: "Build" |
| 4 | + |
| 5 | +on: |
| 6 | + workflow_call: |
| 7 | + inputs: |
| 8 | + language: |
| 9 | + required: true |
| 10 | + type: string |
| 11 | + description: "Language code (e.g. de, it, es, etc) indicating the language of the documentation." |
| 12 | + repo: |
| 13 | + required: false |
| 14 | + type: string |
| 15 | + default: ${{ github.repository }} |
| 16 | + description: "Repo path (e.g. php/doc-de) to build the documentation from." |
| 17 | + repo_ref: |
| 18 | + required: false |
| 19 | + type: string |
| 20 | + default: ${{ github.ref }} |
| 21 | + description: "Repository checkout ref, defaults ref that triggered the action (github.ref)." |
| 22 | + doc_base: |
| 23 | + required: false |
| 24 | + type: string |
| 25 | + default: 'php/doc-base' |
| 26 | + description: "Repo path to the doc-base repository, defaults to php/doc-base." |
| 27 | + doc_en: |
| 28 | + required: false |
| 29 | + type: string |
| 30 | + default: 'php/doc-en' |
| 31 | + description: "Repo path to the doc-en repository, defaults to php/doc-en." |
| 32 | + |
| 33 | +jobs: |
| 34 | + build: |
| 35 | + name: "Build - ${{ inputs.language }} - ${{ inputs.repo }}" |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - name: "Checkout doc-base" |
| 39 | + uses: "actions/checkout@v4" |
| 40 | + with: |
| 41 | + path: "doc-base" |
| 42 | + repository: ${{ inputs.doc_base }} |
| 43 | + |
| 44 | + - name: "Checkout ${{ inputs.language }} from ${{ inputs.repo }}" |
| 45 | + uses: "actions/checkout@v4" |
| 46 | + with: |
| 47 | + path: ${{ inputs.language }} |
| 48 | + repository: ${{ inputs.repo }} |
| 49 | + ref: ${{ inputs.repo_ref }} |
| 50 | + |
| 51 | + - name: "Checkout ${{ inputs.doc_en }} as fallback" |
| 52 | + if: "${{ inputs.language }} != 'en'" |
| 53 | + uses: "actions/checkout@v4" |
| 54 | + with: |
| 55 | + path: "en" |
| 56 | + repository: ${{ inputs.doc_en }} |
| 57 | + |
| 58 | + - name: "Run QA scripts for EN docs" |
| 59 | + if: "${{ inputs.language }} == 'en'" |
| 60 | + run: | |
| 61 | + php doc-base/scripts/qa/extensions.xml.php --check |
| 62 | + php doc-base/scripts/qa/section-order.php |
| 63 | +
|
| 64 | + - name: "Build documentation for ${{ inputs.language }}" |
| 65 | + run: "php doc-base/configure.php --disable-libxml-check --enable-xml-details --redirect-stderr-to-stdout --with-lang=${{ inputs.language }}" |
0 commit comments