From 5ecf5bafd1e89242c9d0fe97df62398449824640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Fri, 27 Mar 2020 10:59:12 +0100 Subject: [PATCH] Add initial gitlab-ci configuration --- .gitlab-ci.yaml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .gitlab-ci.yaml diff --git a/.gitlab-ci.yaml b/.gitlab-ci.yaml new file mode 100644 index 0000000..b6f3542 --- /dev/null +++ b/.gitlab-ci.yaml @@ -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"