This commit is contained in:
parent
cba97991f3
commit
051b997999
8 changed files with 359 additions and 792 deletions
|
|
@ -1,23 +1,17 @@
|
|||
# Cloonar TYPO3 Staged Deployment Workflow
|
||||
#
|
||||
# Staged deployment: build → deploy to stage → run E2E tests → switch release
|
||||
#
|
||||
# Usage in project's .forgejo/workflows/deploy.yaml:
|
||||
# name: Deploy
|
||||
# on:
|
||||
# push:
|
||||
# branches: [main]
|
||||
# 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:
|
||||
# deploy:
|
||||
# uses: infrastructure/ci-templates/.forgejo/workflows/typo3-staged-deploy.yaml@main
|
||||
# build:
|
||||
# uses: infrastructure/ci-templates/.forgejo/workflows/typo3-build.yaml@main
|
||||
# with:
|
||||
# stage_url: https://myproject.cloonar.dev
|
||||
# php_version: '8.3'
|
||||
# secrets:
|
||||
# stage_key: ${{ secrets.STAGE_KEY }}
|
||||
# prod_key: ${{ secrets.PROD_KEY }}
|
||||
# build_frontend: true
|
||||
|
||||
name: TYPO3 Staged Deploy
|
||||
name: TYPO3 Build
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
|
@ -27,14 +21,26 @@ on:
|
|||
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
|
||||
# ===========================================================================
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -48,21 +54,32 @@ jobs:
|
|||
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: |
|
||||
composer install --prefer-dist --no-progress --no-dev --ignore-platform-reqs
|
||||
curl -o deploy-lib.php https://git.cloonar.com/infrastructure/ci-templates/raw/branch/main/deployer/typo3-recipe.php
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Create artifact
|
||||
run: |
|
||||
tar -czf build.tar.gz \
|
||||
bin public packages config vendor build composer.json composer.lock deploy-lib.php \
|
||||
bin public packages config vendor build composer.json composer.lock \
|
||||
$([ -d "node_modules" ] && echo "node_modules") \
|
||||
$([ -d "dist" ] && echo "dist") \
|
||||
2>/dev/null || true
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-${{ github.sha }}
|
||||
name: ${{ inputs.artifact_name }}
|
||||
path: build.tar.gz
|
||||
retention-days: 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue