-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
50 lines (46 loc) · 1.16 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
image: docker:stable
variables:
HUGO_DOWNLOAD: https://github.com/gohugoio/hugo/releases/download/v0.68.3/hugo_extended_0.68.3_Linux-64bit.tar.gz
CONTAINER_IMAGE_NAME: roosdotclick
REGISTRY: registry.gitlab.com
CONTAINER_IMAGE: $REGISTRY/rooster212/roosdotclick/$CONTAINER_IMAGE_NAME:latest
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: "" # https://gitlab.com/gitlab-org/gitlab-ce/issues/64959
stages:
- build
- docker
build:
stage: build
image: node:13.12-slim
before_script:
- apt update && apt install wget git -y
- wget -q -O hugo.tar.gz ${HUGO_DOWNLOAD}
- tar -zxvf hugo.tar.gz hugo
- cp hugo /usr/local/bin/
script:
- npm ci
- hugo --minify
artifacts:
paths:
- public/
expire_in: 1 week
tags:
- docker
docker-build:
stage: docker
services:
- name: docker:19.03-dind
entrypoint: ["env", "-u", "DOCKER_HOST"]
command: ["dockerd-entrypoint.sh"]
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
dependencies:
- build
script:
- docker build -t $CONTAINER_IMAGE .
- docker push $CONTAINER_IMAGE
only:
- master
tags:
- docker