-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
43 lines (40 loc) · 1.01 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
stages:
- build
- push
Build Docker image:
stage: build
image: ruby:latest
before_script:
- gem install bundler
- bundle install
script:
- bundle exec jekyll build
artifacts:
paths:
- _site
quay.io:
stage: push
only:
- master
image: docker:stable
services:
- docker:dind
before_script:
- echo "$QUAY_PASSWORD" | docker login -u "$QUAY_USER" --password-stdin https://quay.io
script:
- docker build -t $QUAY_REPOSITORY:latest -t $QUAY_REPOSITORY:git-$CI_COMMIT_SHA .
- docker push $QUAY_REPOSITORY:latest
- docker push $QUAY_REPOSITORY:git-$CI_COMMIT_SHA
registry.gitlab.com:
stage: push
only:
- master
image: docker:stable
services:
- docker:dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker build -t $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:git-$CI_COMMIT_SHA .
- docker push $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:git-$CI_COMMIT_SHA