-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
40 lines (37 loc) · 860 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
stages:
- build
- deploy
build_production:
stage: build
tags:
- deploy
only:
- production
image: lorisleiva/laravel-docker:latest
before_script:
- cp .env.prod.example .env
- echo "RGAPI=${SECRET_API_KEY}" >> .env
script:
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- php artisan key:generate
cache:
key: ${CI_COMMIT_REF_SLUG}-composer
paths:
- vendor/
artifacts:
paths:
- vendor/
- .env
expire_in: 1 days
when: always
deploy_production:
stage: deploy
only:
- production
tags:
- deploy
image: tiangolo/docker-with-compose
script:
- docker-compose -f docker-compose.deploy.yml build
- docker-compose -f docker-compose.deploy.yml down
- docker-compose -f docker-compose.deploy.yml up -d --force-recreate