Recipes: Continuous Integration on GitLab
Continuous Integration works by pushing small code chunks to your application’s code base hosted in a Git repository, and, to every push, run a pipeline of scripts to build, test, and validate the code changes before merging them into the main branch. This recipe helps you set up CI/CD on GitLab and automate your production build!.
Prerequisites
- Make sure you have the Gatsby CLI installed
- A GitLab account
Directions
- Create a gatsby site
- Change directory and start a development server
Stop your development server (
Ctrl + C
on your command line in most cases)Create a
.gitlab-ci.yml
with the following content:
git push <you-remote-gitlab-repo>
- Check out your pipeline under the CI/CD option.
Additional resources
See how you can develop this file into something more real world GitLab CI/CD Docs
Check this especially to learn how to make your newly build available for a next job - GitLab Job Artifacts Docs