40 lines
783 B
YAML
40 lines
783 B
YAML
|
stages:
|
||
|
- build
|
||
|
- deploy
|
||
|
|
||
|
image: debian:latest
|
||
|
variables:
|
||
|
BUILDDIR: "build/"
|
||
|
|
||
|
build:
|
||
|
stage: build
|
||
|
before_script:
|
||
|
- apt-get update
|
||
|
- apt-get install -y make lektor imagemagick
|
||
|
script:
|
||
|
- make build
|
||
|
artifacts:
|
||
|
expire_in: 12 hours
|
||
|
paths:
|
||
|
- "build/"
|
||
|
|
||
|
deploy:
|
||
|
stage: deploy
|
||
|
only:
|
||
|
- master
|
||
|
environment:
|
||
|
name: production
|
||
|
url: https://ungleich.ch/
|
||
|
before_script:
|
||
|
# Install dependencies
|
||
|
- apt-get update
|
||
|
- apt-get install -y make openssh-client rsync
|
||
|
# Configure the SSH Agent
|
||
|
- eval $(ssh-agent -s)
|
||
|
- echo "$CD_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
||
|
- mkdir -p ~/.ssh
|
||
|
- echo "$CD_SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
|
||
|
- chmod 644 ~/.ssh/known_hosts
|
||
|
script:
|
||
|
- make deploy
|