Created
February 25, 2025 15:42
-
-
Save wowaTYPO3/8959d23c88f834a42448d849d0810d47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Definieren eines Ankers für gemeinsame Konfigurationen | |
.deploy_template: &deploy_template | |
stage: deploy | |
image: php:8.3-cli | |
before_script: | |
# Installieren notwendiger Tools und Abhängigkeiten | |
- apt-get update && apt-get install -y git unzip libzip-dev libicu-dev libonig-dev rsync openssh-client | |
# Installieren und Aktivieren von PHP-Erweiterungen | |
- docker-php-ext-install mbstring intl zip | |
# Installieren von Composer | |
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | |
# Installieren von Deployer | |
- composer global require deployer/deployer:^7.0 | |
# SSH-Setup | |
- eval $(ssh-agent -s) | |
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - | |
- mkdir -p ~/.ssh | |
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts | |
- chmod 644 ~/.ssh/known_hosts | |
# Deaktivieren der strikten Host-Key-Überprüfung | |
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config | |
script: | |
- composer install --no-dev --no-ansi --no-interaction --no-scripts --prefer-dist --ignore-platform-reqs | |
- ~/.composer/vendor/bin/dep deploy production -vvv | |
resource_group: production | |
stages: | |
- deploy | |
staging_deploy: | |
<<: *deploy_template | |
only: | |
- staging | |
production_deploy: | |
<<: *deploy_template | |
only: | |
- main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment