GitLab’s manual workflows offers users the control to decide when the workflow should commence. The workflow is often defined in a gitlab-ci.yml
file. The simplest template looks like the following.
stages:
- deploy
git_status:
stage: deploy
script:
- echo "hello"
- ls
- pwd
- git pull origin main
- git status
when: manual
allow_failure: true
stages
: Defines the stages in our CI/CD pipeline. In this scenario, we have a single stage named “deploy,” signifying the final phase before deployment.git_status
: The identifier for our job, customizable to suit our project’s needs.script
: Specifies the commands to be executed by GitLab upon job activationwhen: manual
: mandates manual intervention before proceedingallow_failure: true
: Provides leniency in the event of job failure
Once the above changes have been committed, head over to the pipelines section. Build > Pipelines and click on the “Play” button adjacent to the job.
This should run the pipeline.
This can be used to create a release for a project or for any other manual inspecting of the project such as running a lighthouse evaluation on a reactjs project.
This article is also published in: https://dev.to/parkerrobert/manual-workflows-in-gitlab-55db