-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
61 lines (54 loc) · 1.17 KB
/
.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
image: code.if8.io:5050/infinit8/snapwinit:latest
services:
- mariadb
variables:
MARIADB_ROOT_HOST: mariadb
MARIADB_DATABASE: snapwinit
MARIADB_USER: snapwinit
MARIADB_PASSWORD: snapwinit
MARIADB_ROOT_PASSWORD: snapwinit
stages:
- build
- test
- deploy
composer:
stage: build
script:
- composer install
- cp .env.example .env
- php artisan key:generate
artifacts:
expire_in: 1 month
paths:
- vendor/
- .env
npm:
stage: build
image: node:16-alpine
script:
- npm install
- npm run production
cache:
key: ${CI_COMMIT_REF_SLUG}-npm
paths:
- node_modules/
artifacts:
expire_in: 1 month
paths:
- public/build/
- public/manifest.json
testing:
stage: test
script:
- php artisan migrate
- php artisan serve &
- vendor/bin/phpunit
deploy_production:
stage: deploy
only:
- master
script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" > /tmp/id_rsa && chmod 400 /tmp/id_rsa && ssh-add /tmp/id_rsa && mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- envoy run deploy