.gitlab-ci.yml 922 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
Guido Gunther's avatar
Guido Gunther committed
9
    - apt-get -y install make python3-sphinx libxml2-utils
Guido Gunther's avatar
Guido Gunther committed
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
23
24
25
26
27
28
29
30
31

publish:
  stage: deploy
  environment:
    name: production
    url: http://storage.puri.sm/testdeploy/
  before_script:
    - export DEBIAN_FRONTEND=noninteractive
    - apt-get -y update
    - apt-get -y install ssh rsync
  tags:
    - librem5
  script:
    # Don't publish in forks
Guido Gunther's avatar
Guido Gunther committed
32
    - '[ "$CI_PROJECT_NAMESPACE" == "guido.gunther" ] || exit 0'
33
34
35
36
37
38
39
40
41
    - 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
    - rsync -av  -e "ssh -l $SSH_USER -p $SSH_PORT" --delete-after _build $RSYNC_TARGET
  only:
    - master