Skip to content

Commit

Permalink
[TASK] Drop deploy targets and simplify deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott committed Nov 22, 2024
1 parent 6bc9ab2 commit df8b8d1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 86 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: Continuous Integration / Deployment (CI/CD)

on:
push:
branches:
- develop
- production
- stage
pull_request:

jobs:
Expand All @@ -21,7 +17,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:2

- name: Get Composer Cache Directory
id: composer-cache
Expand Down Expand Up @@ -57,7 +52,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:2

- name: Get Composer Cache Directory
id: composer-cache
Expand Down Expand Up @@ -93,7 +87,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:2

- name: Get Composer Cache Directory
id: composer-cache
Expand Down Expand Up @@ -129,7 +122,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:2

- name: Get Composer Cache Directory
id: composer-cache
Expand Down Expand Up @@ -167,7 +159,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:2

- name: Get Composer Cache Directory
id: composer-cache
Expand Down Expand Up @@ -205,7 +196,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:2

- name: Get Composer Cache Directory
id: composer-cache
Expand Down Expand Up @@ -243,7 +233,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:2

- name: Get Composer Cache Directory
id: composer-cache
Expand Down Expand Up @@ -286,7 +275,7 @@ jobs:
- validation
- php_coding_standards
- php_stan
if: ${{ github.event_name == 'push' }}
if: (github.ref == 'refs/heads/production') && github.event_name == 'push' && (github.repository == 'TYPO3/get.typo3.org')
uses: ./.github/workflows/deployment.yml
secrets:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
Expand Down
27 changes: 2 additions & 25 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,15 @@ name: Deployment

on:
workflow_call:
inputs:
php_version:
description: 'PHP version to be used for the deployment.'
default: '8.2'
required: false
type: string
composer_version:
description: 'Composer version to be used for the deployment.'
default: '2'
required: false
type: string
secrets:
SSH_PRIVATE_KEY:
required: true
SSH_PASSPHRASE:
required: true

jobs:
print_inputs:
name: Print Inputs
runs-on: ubuntu-latest

steps:
- name: Print the inputs
run: |
echo PHP version: ${{ inputs.php_version }}
echo Composer version: ${{ inputs.composer_version }}
deploy:
name: Deploy
needs:
- print_inputs
runs-on: ubuntu-latest

steps:
Expand All @@ -54,8 +31,8 @@ jobs:
- name: Set up PHP Version
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php_version }}
tools: composer:${{ inputs.composer_version }}, andres-montanez/magallanes
php-version: '8.2'
tools: andres-montanez/magallanes

- name: Get Environment
id: environment
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/manual-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,11 @@ name: Manual Deployment

on:
workflow_dispatch:
inputs:
php_version:
description: 'PHP version to be used for the deployment.'
default: '8.2'
required: true
type: choice
options:
- '8.2'
- 'latest'
- 'nightly'
composer_version:
description: 'Composer version to be used for the deployment.'
default: '2'
required: true
type: string

jobs:
deployment:
name: Deployment
uses: ./.github/workflows/deployment.yml
with:
php_version: ${{ github.event.inputs.php_version }}
composer_version: ${{ github.event.inputs.composer_version }}
secrets:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_PASSPHRASE: ${{ secrets.SSH_PASSPHRASE }}
31 changes: 0 additions & 31 deletions .mage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,6 @@ magephp:
- ./phpunit.xml.dist
- ./README.md
environments:
develop:
user: get-stage
from: ./* ./.env
host_path: ./site/mage/
releases: 3
hosts:
- t3o04.typo3server.ch
pre-deploy:
- exec: { cmd: "echo \"APP_ENV=prod\" >> .env.local", desc: "Create .env.local" }
- composer/install: { flags: '--no-dev --no-progress --optimize-autoloader' }
on-deploy:
- exec: { cmd: 'mkdir -p var', desc: 'Create var folder' }
- exec: { cmd: 'mkdir -p var/satis', desc: 'Create var/satis folder' }
- exec: { cmd: 'test -d ~/site/shared/public/satis || mkdir -p ~/site/shared/public/satis', desc: 'Create shared/public/satis folder' }
- fs/link: { from: "../../../shared/.env.local", to: ".env.local" }
- fs/link: { from: "../../../../shared/public/satis", to: "public/satis" }
- fs/link: { from: "satis/p", to: "public/p" }
- fs/link: { from: "satis/p2", to: "public/p2" }
- fs/link: { from: "satis/aliases.json", to: "public/aliases.json" }
- fs/link: { from: "satis/packages.json", to: "public/packages.json" }
- exec: { cmd: "sqlite3 ~/site/mage/current/var/gettr.db '.backup var/gettr.db'", desc: "Copy DB" }
- exec: { cmd: "php-restart", desc: "Restart PHP and reset OPcache" }
- exec: { cmd: "php ./bin/console doctrine:migrations:sync-metadata-storage --no-interaction", desc: "Synchronize DB Migrations" }
- exec: { cmd: "php ./bin/console doctrine:migrations:migrate --no-interaction", desc: "Apply DB Migrations" }
- exec: { cmd: "php ./bin/console cache:clear --env=prod", desc: "Clear Cache", timeout: 600 }
- exec: { cmd: "php ./bin/console cache:warmup --env=prod", desc: "Cache Warmup", timeout: 600 }
- exec: { cmd: "crontab cnf/crontab-dev.cron", desc: "Install crontab" }
on-release:
- exec: { cmd: "php-restart", desc: "Restart PHP and reset OPcache again" }
post-release:
post-deploy:
production:
user: get-prod
from: ./* ./.env
Expand Down

0 comments on commit df8b8d1

Please sign in to comment.