Add initial gitlab-ci configuration

This commit is contained in:
fnux 2020-03-27 10:59:12 +01:00
parent 86ea16a422
commit 5ecf5bafd1

36
.gitlab-ci.yaml Normal file
View file

@ -0,0 +1,36 @@
stages:
- build
- deploy
image: fedora:latest
variables:
BUILDDIR: "build/"
build:
stage: build
before_script:
- dnf install -y hugo
script:
- git submodule update --init --recursive
- hugo
artifacts:
expire_in: 12 hours
paths:
- "public/"
deploy:
stage: deploy
only:
- master
environment:
name: production
url: https://status-devel.ungleich.ch/
before_script:
# 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:
- sftp -r fnux@staticwebhosting.ungleich.ch <<< "put -r public/* public_html/status-devel"