Vercel Deployments
Vercel has a GitLab integration that will build and deploy feature branches to a unique URL to be viewed by anyone. However, this external build step does not follow a custom .gitlab-ci.yml jobs order. Rather it happens synchronously and will run at the same time as any other jobs.
To get around this, we can disable all deployments that run not on a master or preview branches by using the Ignored Build Step input field found in Vercel > [project name] > Git and adding a custom condition - this can be an inline statement like [ "$VERCEL_ENV" != production ] or can be a bash command to a script like bash script.sh. This prevents builds on all deployments except certain cases.
This is used in conjunction with automated-migrations and a new Environment Variable is created and set on a deployment with the name of Contentful environment the deployment should point to.
Preview
A domain has been set up which will show all Draft and Published content - https://preview.content.rapha.cc.
This will have exactly the same codebase as master, with the only difference being the data that is fetched from Contentful. This URL should be used to view and check content before it is published (i.e when creating a new Story page, or when updating text on a current Clubhouses).
This is kept up to date by force a master rebase and push on the preview branch everytime there is a commit on master.
Feature Deployments
Instead of using UAT, Alpha, Beta, Production etc, new front end applications will have a single ever-lasting production environment assigned to a domain (there may also be occasional instances for a Preview envrionemnt). All other environments will be short lived and assigned a URL based from their Git branch name.
Examples below:
| domain | Description | Git Branch |
|---|---|---|
| https://content.rapha.cc | Production code running against master / main branch | master |
| https://alderaan-feature-cms-220-raphacc.vercel.app | Contains code from master at time of branch creation and any feature work | feature-cms-220 |