-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
73 lines (67 loc) · 1.56 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
62
63
64
65
66
67
68
69
70
71
72
73
stages:
- deps
- test
- deploy
deps:
stage: deps
image: composer
script:
- composer install --no-dev --no-progress --prefer-dist --optimize-autoloader
artifacts:
expire_in: 1 day
paths:
- "vendor"
depsdev:
stage: deps
image: composer
script:
- composer install --dev --no-progress --prefer-dist --optimize-autoloader
artifacts:
expire_in: 1 day
paths:
- "vendor"
test:
stage: test
image: php:8.1-cli
before_script:
- echo 'memory_limit = 512M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini;
script:
- ./vendor/bin/phpstan analyse --no-progress --error-format gitlab > phpstan.json
artifacts:
expire_in: 1 day
paths:
- "phpstan.json"
when: always
reports:
codequality: phpstan.json
rules:
- exists:
- phpstan.neon
dependencies:
- depsdev
deploy:ci:
stage: deploy
image: node:20-alpine
script:
- npm install # install form package-lock.json
- npm install -g serverless # global install serverless (this allows usage of env variables)
- npm run build # compile the css
- serverless deploy --stage dev
dependencies:
- depsdev
only:
variables:
- $CI_COMMIT_BRANCH == "master"
deploy:prod:
stage: deploy
image: node:20-alpine
script:
- npm install # install form package-lock.json
- npm install -g serverless # global install serverless (this allows usage of env variables)
- npm run build # compile the css
- serverless deploy --stage prod
dependencies:
- deps
only:
refs:
- tags