Commit 936f6555 authored by Arie Peterson's avatar Arie Peterson 🐚
Browse files

Merge branch '10-automatically-deploy-documentation-to-cryptops-com' into 'master'

Resolve "Automatically deploy documentation to cryptops.com"

Closes #10

See merge request !4
parents d6c0c3ee 9949ceef
Pipeline #3277 passed with stages
in 50 seconds
......@@ -3,3 +3,4 @@
*.o
cryptops-api
docs/_build
env
stages:
- build
- deploy
image: pstauffer/python3:latest
variables:
FTP_USER: 'webmaster_unlog_nl'
DOMAIN_NAME: 'cryptops.com'
build:
stage: build
script:
# Install sphinx
- pip install sphinx recommonmark
- apk update
- apk add make
# Build the website
- cd docs && make html
artifacts:
paths:
- docs/_build/html
expire_in: 1 week
deploy-master:
stage: deploy
environment:
name: master
url: $DOMAIN_NAME
only:
- '/^master$/'
variables:
SUBDOMAIN: 'DEFAULT'
script:
- apk update
- apk add openssh-client rsync bash
- cd docs && ./deploy.sh
#!/bin/bash
# Deploy HTML documentation directory. Must be run from docs directory.
# Run ssh-agent and add ssh key.
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
# Add server's ssh host key to known hosts.
mkdir -p ~/.ssh
chmod 700 ~/.ssh
[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
# Upload site.
rsync -r --verbose --compress --delete ./_build/html/* \
"${FTP_USER}@ftp.greenhost.nl:${DOMAIN_NAME}/${SUBDOMAIN}"
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