GitHub Pages, for GitLab.
Step 1) Create your deploy key pair
Create a SSH key pair for GitLab to use as deploy keys.
ssh-keygen -t rsa -C "email@example.com" -f "$(pwd)/keys/id_rsa"
They should be in path
Step 2) Configure GitLab Pages server
Clone this repo and install it's necessary dependencies:
# Already cloned repo npm install bower install
Copy default config to custom config file.
cp default_config.js _config.js
Edit your new _config.js file for your setup.
Step 3) Start your GitLab Pages server
And start the server!
Login using your GitLab User Token at http://localhost:1337.
How It Works
- User logs into Web UI, which authenticates against GitLab with node-gitlab and retrieves a private key for subsequent requests.
- Select the Project to enable GitLab Pages support for it. Available Projects list is pulled from GitLab with node-gitlab.
- The selected project will setup a Deploy Key and Webhook for GitLab Pages.
- When the user pushes to GitLab, a webhook event is sent to GitLab Pages server.
- The Webhook is handled by gitlab-webhook and the project is pulled (or cloned) with nodegit to the GitLab Pages configured clones install directory.
gl-pagesbranch is checked out with nodegit. (This can optionally be configured to be
gh-pagesbranch to work on both GitHub and GitLab).
- The public content, a GitLab Page, is served using Expressjs. Each project will be served from a different subdirectory in the form of
server.publicUrl/pages/:username/:projectName/. It is recommended that the
publicPagesDirbe served using Nginx or Apache.