-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
65 lines (60 loc) · 1.64 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
image: ruby:3.1
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- vendor
stages:
- build
- test
- deploy
build:
stage: build
before_script:
- git submodule sync
- git submodule update --init
- gem install bundler
- bundle config set path 'vendor'
- bundle config set without 'test'
- bundle install
script:
- mkdir -p adamliter.org
- bundle exec rake build
artifacts:
paths:
- adamliter.org
name: "$CI_COMMIT_REF_SLUG"
expire_in: 1 hour
test:
stage: test
before_script:
- gem install bundler
- bundle config set path 'vendor'
- bundle config set without 'development'
- bundle install
- "which locale-gen || (apt-get update -y && apt-get install locales -y)"
- echo "en_US UTF-8" > /etc/locale.gen
- locale-gen en_US.UTF-8
- export LANG=en_US.UTF-8
- export LANGUAGE=en_US.UTF-8
- export LC_ALL=en_US.UTF-8
script:
- bundle exec rake deploy:proof
deploy:
stage: deploy
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_PROJECT_PATH == "adamliter/adamliter.org"
before_script:
- "which rsync || ( apt-get update -y && apt-get install rsync -y )"
- "which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )"
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- gem install bundler
- bundle config set path 'vendor'
- bundle config set without 'development test'
- bundle install
script:
- bundle exec rake deploy:deploy_prod