2018-10-28 22:15:18 +04:00
|
|
|
variables:
|
|
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
2019-02-10 13:25:46 +04:00
|
|
|
HUGO_ARCHIVE: https://github.com/gohugoio/hugo/releases/download/v0.54.0/hugo_0.54.0_Linux-64bit.tar.gz
|
2018-10-28 22:09:58 +04:00
|
|
|
|
|
|
|
build site:
|
|
|
|
stage: build
|
|
|
|
before_script:
|
2018-10-28 22:22:43 +04:00
|
|
|
- apk --no-cache add ca-certificates wget openssh-client
|
2018-10-28 22:11:24 +04:00
|
|
|
- update-ca-certificates
|
2018-10-28 22:27:27 +04:00
|
|
|
- wget $HUGO_ARCHIVE
|
2019-02-10 13:25:46 +04:00
|
|
|
- tar xf hugo_0.54.0_Linux-64bit.tar.gz -C /usr/local/bin
|
2018-10-28 22:09:58 +04:00
|
|
|
script:
|
|
|
|
- /usr/local/bin/hugo -d tango.hodakov.me
|
|
|
|
artifacts:
|
|
|
|
untracked: true
|
|
|
|
expire_in: 4 hours
|
|
|
|
paths:
|
|
|
|
- tango.hodakov.me
|
|
|
|
|
|
|
|
deploy site:
|
|
|
|
stage: deploy
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
before_script:
|
|
|
|
- apk add --no-cache openssh-client
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
- echo "$DEPLOY_KEY" | tr -d '\r' > ~/.ssh/id_rsa
|
|
|
|
- chmod 600 ~/.ssh/id_rsa
|
|
|
|
- eval "$(ssh-agent -s)"
|
|
|
|
- ssh-add ~/.ssh/id_rsa
|
|
|
|
- ssh-keyscan -H $DEPLOY_HOST >> ~/.ssh/known_hosts
|
|
|
|
script:
|
|
|
|
- scp -r tango.hodakov.me $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH
|