diff --git a/lib/dpl/provider/pages.rb b/lib/dpl/provider/pages.rb
index <HASH>..<HASH> 100644
--- a/lib/dpl/provider/pages.rb
+++ b/lib/dpl/provider/pages.rb
@@ -83,7 +83,12 @@ module DPL
       def api  # Borrowed from Releases provider
         error 'gh-token must be provided for Pages provider to work.' unless @gh_token
 
-        @api ||= Octokit::Client.new(:access_token => @gh_token)
+        return @api if @api
+
+        api_opts = { :access_token => @gh_token }
+        api_opts[:api_endpoint] = "https://#{gh_url}/api/v3/" unless @gh_url.empty?
+
+        @api = Octokit::Client.new(api_opts)
       end
 
       def user
Consider GHE endpoint for Pages deployment