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"