Skip to content
This repository was archived by the owner on Oct 24, 2022. It is now read-only.

Gitlab Pages Workflow

William Johnston edited this page Jun 16, 2015 · 1 revision

At American Public Media, we use Slimdown to allow producers to manage static pages, without them having access to or needing to deploy the Rails site. We use a combination of self-hosted GitLab, GitLab CI, and Capistrano to do this.

Two repositories

The main repository is the Rails app itself. Inside it, there is a directory in lib/pages in which pages are stored for development. An initializer is sets Slimdown to point at this directory. This directory is added to .gitignore and Capistrano's shared dirs configuration. Once deployed, this folder is symlinked to a shared location which is itself a symlink to the location in which the pages themselves are deployed.

The secondary repository contains three directories: pages, files, and _deploy. Inside of _deploy is the Capistrano deployment configuration. Inside of files are static files such as images and pdfs which apache is set to deliver via an alias. Finally, inside of pages is the Markdown file structure which Slimdown references and to which the earlier mentioned symlink points.

Editing and Deployment

A producer will go to GitLab and edit the markdown file inside the embedded editor. Upon save, GitLab CI runs the tests (which presently comprise ls -la) and upon successful completion of the tests, the Capistrano deployment script inside of _deploy.

In future we may add some markdown validation to the tests so that deployment doesn't occur if the Markdown is invalid.

Clone this wiki locally