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

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

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