Skip to content

Reusable Workflows

The middag-io organization maintains reusable workflows in a central repository. Consuming repositories call these workflows with uses:, inheriting CI, release, documentation, deploy, and operations logic without duplication.

Moodle is MIDDAG's primary project family. WordPress remains supported, but it was mainly the first operational validation.

Overview

WorkflowFamilyPurposeVersion
Moodle Plugin CIMoodlePHP/Composer validation for Moodle plugins@workflows-v1
Moodle Plugin DistMoodleBuild distributable Moodle plugin ZIP@workflows-v1
Moodle Plugin ReleaseMoodleMoodle release with ZIP and Private Satis@workflows-v1
WordPress Plugin CIWordPressLinting, static analysis, and tests for WP plugins@workflows-v1
WordPress Theme CIWordPressLinting and static analysis for WP themes@workflows-v1
WP Plugin Post-ReleaseWordPressBuild dist ZIP and upload to GitHub Release@workflows-v1
Composer Package CIPHP/ComposerCI for PHP/Composer libraries@workflows-v1
Cloudflare App CIAppsCI for Next/Vite/OpenNext apps@workflows-v1
Cloudflare App DeployAppsApp deploy via Wrangler@workflows-v1
Docs DeployDocsBuild and deploy VitePress sites to Cloudflare Pages@workflows-v1
MkDocs BuildDocsStrict MkDocs build@workflows-v1
MkDocs DeployDocsMkDocs deploy to Cloudflare Pages@workflows-v1
Release PleaseReleaseAutomated versioning via conventional commits@workflows-v1
Sync DevelopReleaseMerge main into develop after release@workflows-v1
Docker WP OperationsOperationsBackup, cache flush, and WP-CLI on EC2 servers@workflows-v1

How it works

All workflows are reusable workflows (on: workflow_call). The consuming repository creates a local workflow that references the centralized one:

yaml
# .github/workflows/ci.yml (in the plugin repository)
on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main]

jobs:
  ci:
    uses: middag-io/.github-private/.github/workflows/moodle-plugin-ci.yml@workflows-v1
    with:
      run-check-style: true
      run-check-stan: true

Benefits

  • Standardization — all repositories follow the same CI pipeline.
  • Centralized maintenance — fixes and improvements propagate automatically.
  • Flexibility — boolean and string inputs allow enabling/disabling steps per repository.
  • Secrets control — workflows should declare minimum required secrets when possible.
  • Versioning — stable consumers should use workflow tags/channels, not @main.

Architecture decisions

For more context on why reusable workflows were adopted, see ADR-006: Reusable Workflows.

MIDDAG Tecnologia