Created
November 18, 2024 21:09
-
-
Save solipa365/74e9d8c1efd2309bf463855d7c8e4600 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
stages: | |
- deploy | |
production-deploy: | |
stage: deploy | |
environment: production | |
only: | |
- /^v.*$/ | |
script: | |
- which ssh-agent || (apt-get update -y && apt-get install openssh-client -y) | |
- eval "$(ssh-agent -s)" | |
- echo "$SSH_PRIVATE_KEY" | tr -d "\r" | ssh-add - | |
- ssh -o "StrictHostKeyChecking=no" "$SSH_USER@$SSH_HOST" " | |
cd '$PROJECT_PATH' && | |
php8.2 artisan down && | |
git fetch --all --tags --prune && | |
git checkout '$CI_COMMIT_REF_NAME' && | |
php8.2 composer.phar install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --optimize-autoloader && | |
php8.2 artisan optimize:clear && | |
php8.2 artisan schedule:interrupt && | |
php8.2 artisan schedule:clear-cache && | |
php8.2 artisan migrate --force && | |
php8.2 artisan route:cache && | |
php8.2 artisan view:cache && | |
php8.2 artisan config:cache && | |
npm ci && | |
npm run build && | |
php8.2 artisan up" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment