-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
55 lines (50 loc) · 1.15 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
---
image: circleci/ruby:3.0.3-node-browsers
variables:
CACHE_FALLBACK_KEY: "$CI_COMMIT_REF_SLUG"
before_script:
- gem install bundler
- bundle config set path 'vendor' # Install dependencies into ./vendor/ruby
- sed -i 's/mutex_m (0.2.0)/mutex_m (0.1.1)/g' Gemfile.lock
stages:
- test
- deploy
test:
stage: test
cache:
- key:
files:
- Gemfile.lock
paths:
- vendor/ruby
- key:
files:
- yarn.lock
paths:
- ".yarn-cache/"
script:
- bundle install -j $(nproc)
- yarn install --cache-folder .yarn-cache
- cp config/database.yml.sample config/database.yml
- echo $RAILS_MASTER_KEY > config/master.key
- bundle exec rails db:migrate RAILS_ENV=test
- bundle exec rails test:all
deploy_staging:
cache:
- key:
files:
- Gemfile.lock
paths:
- vendor/ruby
stage: deploy
script:
- bundle install -j $(nproc)
- mkdir ~/.ssh
- mv "$SSH_ID_RSA" ~/.ssh/id_rsa
- mv "$SSH_CONFIG_FILE" ~/.ssh/config
- bundle exec cap staging deploy
environment:
name: staging
url: https://sso-id.com
only:
- main