Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.11 KiB
Newer Older
Nigel Kukard's avatar
Nigel Kukard committed
stages:
Nigel Kukard's avatar
Nigel Kukard committed
    - test-site
    - deploy-site


test:
    stage: test-site
    script:
        - apt-get update
        - apt-get dist-upgrade -y
Nigel Kukard's avatar
Nigel Kukard committed
        - apt-get install -y jekyll bundler
Nigel Kukard's avatar
Nigel Kukard committed
        - bundle install
Nigel Kukard's avatar
Nigel Kukard committed
        - bundle clean --force
Nigel Kukard's avatar
Nigel Kukard committed
        - mkdir build
        - jekyll build --destination=build/
        - 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/