Commit 6d830767 authored by Guido Gunther's avatar Guido Gunther

Publish built html pages automatically

This needs the protected variables

   - RSYNC_TARGET: remote host and folder
   - SSH_USER: ssh user to log in as
   - SSH_PORT: sshd port on the remote side
   - SSH_KEY: ssh private key
   - SSH_HOST_KEY: ssh host key of target gathered via e.g. ssh-keyscan

filled in to work

Closes: #14
parent 842df384
job:
stages:
- build
- deploy
build_html:
stage: build
before_script:
- apt-get -y update
- apt-get -y install make python3-sphinx libxml2-utils
......@@ -10,3 +15,27 @@ job:
paths:
- _build/html
expire_in: 1 week
publish:
stage: deploy
environment:
name: production
url: http://storage.puri.sm/testdeploy/
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- apt-get -y install ssh rsync
tags:
- librem5
script:
# Don't publish in forks
- '[ "$CI_PROJECT_NAMESPACE" == "Librem5" ] || exit 0'
- mkdir -p ~/.ssh/
- chmod 0700 ~/.ssh/
- echo "$SSH_HOST_KEY" > ~/.ssh/known_hosts
- touch ~/.ssh/id_rsa
- chmod 0600 ~/.ssh/id_rsa
- echo "$SSH_KEY" >> ~/.ssh/id_rsa
- rsync -av -e "ssh -l $SSH_USER -p $SSH_PORT" --delete-after _build $RSYNC_TARGET
only:
- master
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment