ci-templates/.forgejo/workflows/typo3-build.yaml
Dominik Polakovics 051b997999
All checks were successful
Self Test / test (push) Successful in 13s
feat: split workflows
2026-02-03 14:27:08 +01:00

85 lines
2.1 KiB
YAML

# TYPO3 Build Workflow
#
# Builds PHP/Node artifacts and uploads them for subsequent deployment jobs.
# Use this as the first step in your composable deployment pipeline.
#
# Usage:
# jobs:
# build:
# uses: infrastructure/ci-templates/.forgejo/workflows/typo3-build.yaml@main
# with:
# php_version: '8.3'
# build_frontend: true
name: TYPO3 Build
on:
workflow_call:
inputs:
php_version:
description: 'PHP version'
required: false
type: string
default: '8.3'
node_version:
description: 'Node.js version'
required: false
type: string
default: '20'
build_frontend:
description: 'Run npm build'
required: false
type: boolean
default: false
artifact_name:
description: 'Name of the build artifact to upload'
required: false
type: string
default: 'build'
env:
COMPOSER_ALLOW_SUPERUSER: 1
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php_version }}
tools: composer
- name: Setup Node.js
if: ${{ inputs.build_frontend }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
- name: Install PHP dependencies
run: composer install --prefer-dist --no-progress --no-dev --ignore-platform-reqs
- name: Install Node dependencies & build
if: ${{ inputs.build_frontend }}
run: |
npm ci
npm run build
- name: Create artifact
run: |
tar -czf build.tar.gz \
bin public packages config vendor build composer.json composer.lock \
$([ -d "node_modules" ] && echo "node_modules") \
$([ -d "dist" ] && echo "dist") \
2>/dev/null || true
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact_name }}
path: build.tar.gz
retention-days: 1