.gitlab-ci.yml 861 Bytes
Newer Older
Mike Jones's avatar
Mike Jones committed
1 2 3 4 5 6
image: dettmering/hugo-build:0.53

variables:
    url: https://netsplit.uk/

before_script:
Mike Jones's avatar
Mike Jones committed
7 8 9
    - apk update
    - apk upgrade
    - apk add yarn
Mike Jones's avatar
Mike Jones committed
10
    - apk add openssh-client
Mike Jones's avatar
Mike Jones committed
11 12 13 14 15 16 17 18

stages:
    - generate
    - deploy

generate:
    stage: generate
    script:
Mike Jones's avatar
Mike Jones committed
19 20 21
        - cd themes/netsplit
        - yarn install
        - cd ../..
Mike Jones's avatar
Mike Jones committed
22
        - hugo
Mike Jones's avatar
Mike Jones committed
23 24 25

deploy:
    stage: deploy
26 27 28
    only:
        refs:
            - master
Mike Jones's avatar
Mike Jones committed
29
    script:
Mike Jones's avatar
Mike Jones committed
30 31 32
        - eval $(ssh-agent -s)
        - mkdir -p ~/.ssh
        - chmod 700 ~/.ssh
Mike Jones's avatar
Mike Jones committed
33
        - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
Mike Jones's avatar
Mike Jones committed
34
        - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
Mike Jones's avatar
Mike Jones committed
35
        - echo "LogLevel=quiet" > ~/.ssh/config
Mike Jones's avatar
Mike Jones committed
36
        - chmod 644 ~/.ssh/known_hosts
Mike Jones's avatar
Mike Jones committed
37 38 39 40
        - cd themes/netsplit
        - yarn install
        - cd ../..
        - hugo
Mike Jones's avatar
Mike Jones committed
41
        - scp -r public $OUTPUT_LOCATION > /dev/null