Skip to content
Snippets Groups Projects
.gitlab-ci.yml 985 B
Newer Older
mazenovi's avatar
mazenovi committed
image: ubuntu:xenial

cache:
  paths:
    - output/ # Node modules and dependencies

before_script:
  - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
  - eval $(ssh-agent -s)
  - ssh-add <(echo "$SSH_PRIVATE_KEY")
  - mkdir -p ~/.ssh
  - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'

build:
  stage: build
  script:
mazenovi's avatar
mazenovi committed
    - apt-get install -y --force-yes build-essential python-dev python-pip git nodejs nodejs-legacy npm
mazenovi's avatar
mazenovi committed
    - pip install --upgrade pip
    - pip install --editable .
m4z3 test's avatar
m4z3 test committed
    - cd content && npm install && cd ..
    - pelican content

  artifacts:
    untracked: true

deploy:
  stage: deploy
  dependencies:
    - build
  script:
mazenovi's avatar
mazenovi committed
    - apt-get install -y --force-yes rsync
    - scp -r output/* mazenod@192.168.100.59:~/public_html/
mazenovi's avatar
mazenovi committed
    - rsync -az --exclude '_' -e ssh output/ mazenod@192.168.100.59:~/public_html/
    - rsync -az --exclude '_' -e ssh output/ $USERNAME@$HOST:~/public_html/