-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
45 lines (39 loc) · 1 KB
/
.gitlab-ci.yml
File metadata and controls
45 lines (39 loc) · 1 KB
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
# This file is a template, and might need editing before it works on your project.
# see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options
build site:
image: registry.gitlab.com/yawik/docker/yarn-git-ssh-rsync:main
stage: build
script:
- env | grep -E "(PORT|APP_ID|EMAIL|YAWIK|STRAPI|GOOGLE|HEADER)" > .env.production
- yarn
- yarn build
artifacts:
expire_in: 1 week
paths:
- dist
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
stages:
- build
- deploy
deploy_master:
stage: deploy
image: registry.gitlab.com/yawik/docker/yarn-git-ssh-rsync:main
environment:
name: staging/$CI_COMMIT_REF_NAME
url: https://cross-solution.de
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
only:
- main
script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
- pm2 deploy production
resource_group: production