-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
53 lines (47 loc) · 1.29 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
image: node:lts
services:
- postgres:15.1-alpine
variables:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
POSTGRES_DB: poca-db
stages:
- build-and-test
- deploy
build-api:
stage: build-and-test
image: node:latest
script:
# Build back-end
- cd apps/api
- yarn install
- rm .env # Needed for gitlab runner (see https://docs.gitlab.com/ee/ci/services/index.html#how-services-are-linked-to-the-job).
- mv .env_gitlab-ci .env # Same as above.
- yarn prisma generate
- yarn build
- yarn prisma db push --force-reset
- yarn test
build-front:
stage: build-and-test
image: node:latest
script:
# Build web interface
- cd apps/web
- yarn install
- yarn build
deploy-railway:
stage: deploy
image: node:latest
only:
- main
script:
#- wget https://github.com/railwayapp/cli/releases/download/v2.1.0/railway_2.1.0_linux_amd64.tar.gz
#- tar -xzf railway_2.1.0_linux_amd64.tar.gz
#- mv railway /usr/local/bin
- bash <(curl -fsSL cli.new)
# Deploy back-end to railway
- cd apps/api
- RAILWAY_TOKEN=9d5ad1cb-b39d-4274-9790-6453cfeac5c8 railway up --service evasive-love
# Deploy front-end to railway
- cd ../web
- RAILWAY_TOKEN=9d5ad1cb-b39d-4274-9790-6453cfeac5c8 railway up --service astonishing-crow