generated from gethinode/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
60 lines (56 loc) · 2 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
#
# Before using this .gitlab-ci.yml:
#
# - This example uses the latest Docker image, but you might want to use the
# exact version to avoid any broken pipelines.
# All available Hugo versions are listed under https://gitlab.com/pages/hugo/container_registry.
# - Read about the difference between hugo and hugo_extended
# https://gitlab.com/pages/hugo/-/blob/main/README.md#hugo-vs-hugo_extended.
# - To change the theme, see
# https://gitlab.com/pages/hugo/-/blob/main/README.md#use-a-custom-theme.
#
image: debian:stable
variables:
GIT_SUBMODULE_STRATEGY: recursive
HUGO_ENV: production
THEME_URL: "github.com/thegeeklab/hugo-geekdoc"
default:
before_script:
- ln -fs /usr/share/zoneinfo/Europe/Prague /etc/localtime
- apt-get update -qq && apt-get upgrade -y -qq && apt-get install -y -qq git golang-go curl rsync openssh-client openssl
- eval $(ssh-agent -s)
- echo "${DEPLOY_KEY}" | openssl base64 -A -d | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan 10.183.148.183 >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- |
curl -IkLs -o NUL -w %{url_effective} \
https://github.com/gohugoio/hugo/releases/v0.125.7|\
grep -o "[^/]*$"| sed "s/v//g"|\
xargs -I T echo \
https://github.com/gohugoio/hugo/releases/download/vT/hugo_extended_T_linux-amd64.deb \
-o hugo_extended_T_linux-amd64.deb | \
xargs curl -kL
- dpkg -i hugo*.deb
- rm -f hugo*.deb
- git submodule update --init --recursive
## Uncomment the following if you use PostCSS. See https://gohugo.io/hugo-pipes/postcss/
#- npm install postcss postcss-cli autoprefixer
test:
script:
- hugo
- rsync -rav --delete-after ./public [email protected]:www/about-dev
rules:
- if: $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH
deploy:
tags:
- kvm
script:
- hugo
- rsync -rav --delete-after ./public/ [email protected]:www/t
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH