.gitlab-ci.yml 932 Bytes
Newer Older
1 2 3 4 5 6
stages:
  - build
  - deploy

build_html:
  stage: build
7 8
  before_script:
    - apt-get -y update
Guido Gunther's avatar
Guido Gunther committed
9
    - apt-get -y install make python3-sphinx libxml2-utils
10 11 12 13
  tags:
    - librem5
  script:
    - make html
Guido Gunther's avatar
Guido Gunther committed
14 15 16 17
  artifacts:
    paths:
    - _build/html
    expire_in: 1 week
18 19 20 21 22

publish:
  stage: deploy
  environment:
    name: production
23
    url: https://developer.puri.sm/Librem5/
24 25 26 27 28 29 30 31
  before_script:
    - export DEBIAN_FRONTEND=noninteractive
    - apt-get -y update
    - apt-get -y install ssh rsync
  tags:
    - librem5
  script:
    # Don't publish in forks
32
    - '[ "$CI_PROJECT_NAMESPACE" == "Librem5" ] || exit 0'
33 34 35 36 37 38
    - 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
39
    - rsync -av -i --stats -e "ssh -l $SSH_USER -p $SSH_PORT" --delete-after _build/html/ $RSYNC_TARGET
40 41
  only:
    - master