Skip to content

Instantly share code, notes, and snippets.

@finoghentov
Created September 19, 2022 15:37
Show Gist options
  • Save finoghentov/d9d7bb4260e7df330a9daa1ee899d433 to your computer and use it in GitHub Desktop.
Save finoghentov/d9d7bb4260e7df330a9daa1ee899d433 to your computer and use it in GitHub Desktop.
image: lorisleiva/laravel-docker:latest
composer:
stage: build
script:
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- cp .env.example .env
- php artisan key:generate
artifacts:
expire_in: 1 month
paths:
- vendor/
- .env
cache:
key: ${CI_COMMIT_REF_SLUG}-composer
paths:
- vendor/
phpunit:
stage: test
dependencies:
- composer
script:
- phpunit --coverage-text --colors=never
.init_ssh: &init_ssh |
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh
chmod 700 ~/.ssh
[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
staging:
stage: deploy
script:
- *init_ssh
- ls
- php artisan deploy 3.92.211.64 -s upload
environment:
name: staging
url: http://dev.yourdomain.com
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment