.gitlab-ci.yml 1.38 KB
Newer Older
Nigel Kukard's avatar
Nigel Kukard committed
1
stages:
Nigel Kukard's avatar
Nigel Kukard committed
2
3
4
5
6
7
8
9
10
    - test-site
    - deploy-site


test:
    stage: test-site
    script:
        - apt-get update
        - apt-get dist-upgrade -y
Nigel Kukard's avatar
Nigel Kukard committed
11
        - apt-get install -y jekyll bundler
12
13
14
15
16
17
        - apt-get install -y locales # hi from #jekyll
        - echo "en_US UTF-8" > /etc/locale.gen 
        - locale-gen en_US.UTF-8
        - export LANG=en_US.UTF-8
        - export LANGUAGE=en_US:en
        - export LC_ALL=en_US.UTF-8 # hi from #jekyll end
Nigel Kukard's avatar
Nigel Kukard committed
18
        - bundle install
Nigel Kukard's avatar
test    
Nigel Kukard committed
19
        - bundle clean --force
Nigel Kukard's avatar
Nigel Kukard committed
20
        - mkdir build
21
        - bundle exec jekyll build --destination=build/
Nigel Kukard's avatar
Nigel Kukard committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
        - cp .htaccess build/
    # Artifacts
    artifacts:
        expire_in: 1 day
        paths:
            - build/


deploy:
    stage: deploy-site
    script:
        - apt-get update
        - apt-get dist-upgrade -y
        - apt-get install -y lftp ca-certificates
        - echo 'set ssl:ca-file "/etc/ssl/certs/ca-certificates.crt"' >> /etc/lftp.conf
        - echo 'set net:max-retries "5"' >> /etc/lftp.conf
        - echo 'set net:timeout "60"' >> /etc/lftp.conf
        - lftp -e "mirror --exclude ^\.git.* --exclude \.gitlab-ci.yaml --delete --reverse --no-perms --verbose  $CI_PROJECT_DIR/build .; quit;" -p $SERVER_PORT -u $CREDENTIALS https://$SERVER/
    only:
        - master@linux.community/linux-community-site
    # Artifacts
    artifacts:
        expire_in: 1 day
        paths:
            - build/