|
1 | 1 | # Build and Deployment Pipelines for TYPO3 Documentation |
2 | 2 |
|
| 3 | +## Reusable CI Workflows |
| 4 | + |
| 5 | +Centralized, reusable GitHub Actions workflows for repositories in the |
| 6 | +[TYPO3-Documentation](https://github.com/TYPO3-Documentation) organization. |
| 7 | + |
| 8 | +### Why |
| 9 | + |
| 10 | +The TYPO3-Documentation org enforces a GitHub Actions **allow-list** with |
| 11 | +SHA-pinned actions. This creates two maintenance challenges: |
| 12 | + |
| 13 | +1. **Composite actions break the allow-list.** Actions like |
| 14 | + `ramsey/composer-install` internally call `actions/cache@v4`, which the |
| 15 | + caller's allow-list must also approve. When the inner action updates its |
| 16 | + SHA, all callers break silently. |
| 17 | + |
| 18 | +2. **~60 workflow files across ~29 repos** must each be updated when action |
| 19 | + SHAs change, backport tooling breaks, or CI patterns evolve. |
| 20 | + |
| 21 | +Reusable workflows solve both problems: they execute in their **own** |
| 22 | +context (this repository), so only *this* repo's action references need to |
| 23 | +stay current. Callers reference a single workflow by tag/SHA and inherit |
| 24 | +all updates automatically. |
| 25 | + |
| 26 | +### Available Reusable Workflows |
| 27 | + |
| 28 | +| Workflow | Purpose | |
| 29 | +|----------|--------| |
| 30 | +| [`reusable-backport.yml`](.github/workflows/reusable-backport.yml) | Backport merged PRs via `korthout/backport-action` | |
| 31 | +| [`reusable-docs-render.yml`](.github/workflows/reusable-docs-render.yml) | Documentation rendering check | |
| 32 | +| [`reusable-php-quality.yml`](.github/workflows/reusable-php-quality.yml) | Code quality: CS Fixer, PHPStan, XML lint | |
| 33 | +| [`reusable-php-tests.yml`](.github/workflows/reusable-php-tests.yml) | PHP test matrix (unit + integration) | |
| 34 | + |
| 35 | +### Usage |
| 36 | + |
| 37 | +Call a workflow from your repository's workflow file: |
| 38 | + |
| 39 | +```yaml |
| 40 | +name: CI |
| 41 | +on: |
| 42 | + push: |
| 43 | + branches: [main] |
| 44 | + pull_request: |
| 45 | + |
| 46 | +jobs: |
| 47 | + tests: |
| 48 | + uses: TYPO3-Documentation/t3docs-ci-deploy/.github/workflows/reusable-php-tests.yml@main |
| 49 | + with: |
| 50 | + php-versions: '["8.2", "8.3", "8.4"]' |
| 51 | + test-unit-command: 'make test-unit' |
| 52 | + |
| 53 | + quality: |
| 54 | + uses: TYPO3-Documentation/t3docs-ci-deploy/.github/workflows/reusable-php-quality.yml@main |
| 55 | + with: |
| 56 | + php-version: '8.2' |
| 57 | + |
| 58 | + docs: |
| 59 | + uses: TYPO3-Documentation/t3docs-ci-deploy/.github/workflows/reusable-docs-render.yml@main |
| 60 | +``` |
| 61 | +
|
| 62 | +Backport workflow (in a separate workflow file triggered on PRs): |
| 63 | +
|
| 64 | +```yaml |
| 65 | +name: Backport |
| 66 | +on: |
| 67 | + pull_request_target: |
| 68 | + types: |
| 69 | + - closed |
| 70 | + - labeled |
| 71 | + |
| 72 | +jobs: |
| 73 | + backport: |
| 74 | + uses: TYPO3-Documentation/t3docs-ci-deploy/.github/workflows/reusable-backport.yml@main |
| 75 | + with: |
| 76 | + label-pattern: "backport *" |
| 77 | +``` |
| 78 | +
|
| 79 | +Each workflow accepts optional inputs with sensible defaults. |
| 80 | +See the individual workflow files for the full list of inputs. |
| 81 | +
|
| 82 | +### Action SHA Pins |
| 83 | +
|
| 84 | +All actions are SHA-pinned to verified commits. Current pins: |
| 85 | +
|
| 86 | +| Action | Version | SHA | |
| 87 | +|--------|---------|-----| |
| 88 | +| `actions/checkout` | v6.0.2 | `de0fac2e4500dabe0009e67214ff5f5447ce83dd` | |
| 89 | +| `actions/cache` | v5.0.3 | `cdf6c1fa76f9f475f3d7449005a359c84ca0f306` | |
| 90 | +| `actions/setup-python` | v6.2.0 | `a309ff8b426b58ec0e2a45f0f869d46889d02405` | |
| 91 | +| `shivammathur/setup-php` | 2.36.0 | `44454db4f0199b8b9685a5d763dc37cbf79108e1` | |
| 92 | +| `korthout/backport-action` | v4.2.0 | `4aaf0e03a94ff0a619c9a511b61aeb42adea5b02` | |
| 93 | + |
3 | 94 | ## ViewHelper Reference |
4 | 95 |
|
5 | 96 | The Fluid ViewHelper Reference is generated automatically based on the PHP source files. |
|
0 commit comments