diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0842e30afa67ce667524a2ec6ca776223d4b82c2..78b17b4000060ad208486a64c5d04c54dd6fc49e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,47 +9,58 @@ update_publications:
     - git checkout -B ${CI_BUILD_REF_NAME}
     - git submodule update --init --remote
     - git add publications
-    - git commit -m "[AUTO] Updating publications submodule" --author="Resource Reasoning Group Backup Bot <rr-gitlab-bot@example.com>" || exit 0
+    - git commit -m "[AUTO] Updating publications submodule\n\n[ci skip]" || exit 0
     - git remote rm rw || true
     - git remote add rw git@gitlab.doc.ic.ac.uk:${CI_PROJECT_PATH}.git
     - eval `ssh-agent`
     - echo "$PUSH_KEY" | ssh-add -
     - git push rw ${CI_BUILD_REF_NAME}
-    - ssh-agent -k
+  variables:
+    GIT_AUTHOR_NAME: Resource Reasoning Group Backup Bot
+    GIT_COMMITTER_NAME: Resource Reasoning Group Backup Bot
+    GIT_AUTHOR_EMAIL: rr-gitlab-bot@example.com
+    EMAIL: rr-gitlab-bot@example.com
+  image: ignoredambience/github-gitlab-sync
+  tags:
+    - docker
   only:
     - triggers
 
-.before_script: &before_script
-  - bundle install --without=development
-  - bundle exec rake init
-
 test:
   stage: test
-  before_script: *before_script
+  image: "ruby:2.4"
+  tags:
+    - docker
+  before_script:
+    - bundle install --without=development
+    - bundle exec rake init
   script:
     - bundle exec rake -s --suppress-backtrace . test
-  except:
-    - triggers
+  artifacts:
+    paths:
+      - _site/
+    expire_in: 1 day
+
+deadlinks:
+  stage: deploy
+  image: "ruby:2.4"
+  tags:
+    - docker
+  before_script:
+    - bundle install --without="build development" --with=test
+  script:
+    - bundle exec rake -s --suppress-backtrace . testlinks
+  allow_failure: true
 
 deploy:
   stage: deploy
   environment: production
-  before_script: *before_script
   script:
-    - bundle exec rake -s --suppress-backtrace . deploy
+    - "umask 0002 && rsync --chmod=Dg+s,ug+rwX,o+rX --chown=:rr -igrp --delete _site/ /vol/rr/www"
   tags:
-    - doc
+    - auth-rr
   only:
     - master
-  except:
-    - triggers
-
-# Not a test stage to prevent race conditions with gem installations.
-deadlinks:
-  stage: deploy
-  script:
-    - bundle exec rake -s --suppress-backtrace . testlinks
-  allow_failure: true
-  except:
-    - triggers
 
+variables:
+  NOKOGIRI_USE_SYSTEM_LIBRARIES: "true"
diff --git a/Gemfile b/Gemfile
index 709c1cd726e0c49499cf7620ee34c3792a788202..6211f9268ce87e307db71ce8e8d06521b77903bc 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,9 +1,11 @@
 source 'https://rubygems.org'
 
 gem 'rake'
-gem 'jekyll'
+group :build do
+  gem 'jekyll'
+end
 
-group :default, :jekyll_plugins do
+group :build, :jekyll_plugins do
   gem 'jekyll-scholar', '~> 5.10'
   #gem 'jekyll-scholar', :git => '/home/thomas/jekyll-scholar', :branch => 'master'
   gem 'jekyll-redirect-from'
diff --git a/Rakefile b/Rakefile
index b8d7ec54325dabcbbdcdd168c7fb4af501aa2da0..7fd1a1bc9edf25ee34f7ac95a688b68f71964672 100644
--- a/Rakefile
+++ b/Rakefile
@@ -34,8 +34,3 @@ desc "Build the site, rebuild when files are edited, and serve via a local http
 task :serve do
   sh "bundle exec jekyll serve"
 end
-
-desc "Deploy the site using rsync"
-task :deploy => :build do
-  sh "umask 0002 && rsync --chmod=Dg+s,ug+rwX,o+rX --chown=:rr -igrp --delete _site/ /vol/rr/www"
-end