forked from DLR-SC/ESID
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
62 lines (57 loc) · 1.31 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
# ! PLEASE NOTE THAT THIS IS ONLY FOR INTERNAL USE AND THE FILE IS UPLOADED ON GITHUB FOR CONVENIENCE
# The bellow pipeline allows to build and deploy the website automatically, whenever developer pushes code to the application.
# The building stage uses a predefined docker image to improve performance.
stages:
- docker
- build
- deploy
ubuntu:publish-docker-image:
stage: docker
tags:
- shell
script:
- cd .docker/ubuntu-gcc
- docker image build -t esid:ubuntu-gcc .
artifacts:
expire_in: 1 hour
paths:
- .docker/ubuntu-gcc
ubuntu:build:
stage: build
image: esid:ubuntu-gcc
tags:
- docker
before_script:
- cd frontend
script:
- npm set cache .npm
- npm ci
- npm run build
cache:
key: "$CI_JOB_NAME"
paths:
- frontend/.npm
artifacts:
expire_in: 1 hour
paths:
- frontend/build
pages:
stage: deploy
image: esid:ubuntu-gcc
tags:
- docker
script:
- folderName=$(echo "${CI_COMMIT_REF_NAME}" | tr / -)
- rm -rf public/$folderName/
- mkdir -p public/$folderName/
- cp -rv frontend/build/* public/$folderName
- cd public
- tree -H '.' -L 1 -d --noreport --charset utf-8 > index.html
cache:
key: "$CI_JOB_NAME"
paths:
- public
artifacts:
expire_in: 1 hour
paths:
- public