doc-base icon indicating copy to clipboard operation
doc-base copied to clipboard

Add Reusable GitHub Actions workflow

Open Ayesh opened this issue 10 months ago • 4 comments

Adds a new reusable.yml GitHub Actions workflow, that can be reused by the doc-base repo and individual php/doc-* repos.

The new reusable workflow accepts inputs that control the repos it checks out, the name of the language, and other tasks that the integration.yaml file previously did.

The new build.yml file then uses the reusable.yml workflow by passing parameters to run the same list of existing language builds.

The advantage of this is that doc-base acts as the baseline GitHub Actions repo, and updates to it (such as changing the runs-on value, updating uses values for other actions such as actions/checkout, and other chores only need to be done on the doc-base, and not on every php/doc-* repo.

Individual php/doc-* repos need to be updated to make use of the new reusable workflows, e.g.:

name: "Build Ukrainian language documentation"

on:
  push:
  pull_request:
    branches: "master"
  workflow_dispatch:

jobs:
  build:
    uses: php/doc-base/.github/workflows/reusable.yml@master
    with:
      language: 'uk'

Ayesh avatar Mar 03 '25 16:03 Ayesh