WEBVTT

00:03.800 --> 00:11.840
So coming back to the YAML file, we have seen how the workflow triggering is done in an automated way.

00:11.880 --> 00:16.760
What is left to explore is if we want to do a manual triggering of the workflow.

00:16.800 --> 00:22.360
We will go through the steps briefly, but first I wanted to bring to your attention the fact that if

00:22.360 --> 00:28.680
we trigger the workflow as it is, the pipeline will run, but the actual jobs will be skipped since

00:28.680 --> 00:31.680
none of the files will have changed from the last commit.

00:31.840 --> 00:35.560
So what we can do is to change all the if conditions in our jobs.

00:36.520 --> 00:45.920
So this will be the if statements here with the changed files, build ID and also the if statements

00:45.920 --> 00:48.240
here with the change file tests ID.

00:51.800 --> 00:54.760
The change in the if condition will look as follows.

00:59.040 --> 01:08.480
So here what we are saying is that all of these steps will run if either a change is done in any of

01:08.520 --> 01:15.720
the docker file or requirements.txt, or if the event name is the workflow dispatch, which means that

01:15.720 --> 01:19.320
we will trigger a manual workflow dispatch workflow.

01:19.840 --> 01:23.360
So let's do this change for all the if statements.

01:32.160 --> 01:37.160
So let's save the YAML file and commit and push our changes first.

01:46.640 --> 01:47.400
We have pushed.

01:47.400 --> 01:55.040
And just to recap we will be testing out the function here the workflow dispatch which coincides with

01:55.040 --> 01:57.040
what we just defined for the event name here.

01:59.360 --> 02:00.360
Let's refresh.

02:03.560 --> 02:08.200
So as you can see, this is the second run of the CI CD pipeline.

02:08.360 --> 02:15.550
When we look into the actual running, the build and push image did not run the setup.

02:15.590 --> 02:21.830
Docker build x up until the build and push docker image, which means that the actual files are being

02:21.830 --> 02:22.350
skipped.

02:23.430 --> 02:27.030
Same happens for the end integration and end to end tests.

02:27.070 --> 02:35.350
The first job initial setup will work, but these jobs which had the if condition were skipped.

02:35.470 --> 02:45.750
Since we have now pushed our changes, let's go on the Cicd pipeline and trigger this run workflow so

02:45.750 --> 02:51.230
that we can see all the changes being triggered and run using the workflow dispatch.

02:54.030 --> 02:56.310
As you can see, the pipeline is running right now.

03:00.390 --> 03:08.270
Since in the if condition, we no longer have only this set to true, but we also have this or condition

03:08.270 --> 03:08.990
over here.

03:09.270 --> 03:15.550
Once we trigger the CI CD pipeline through a workflow dispatch, none of the previous steps that were

03:15.590 --> 03:19.510
previously being skipped will be now skipped.

03:19.670 --> 03:24.030
And same applies for the second job as you saw before.

03:24.470 --> 03:30.230
This was being skipped, but now that we have the condition, the job is being run.

03:30.270 --> 03:35.070
Once all of these finish the run, we should also get a success.

03:35.110 --> 03:35.910
Green tick.

03:35.950 --> 03:38.470
Same as we had for the first run.

03:44.990 --> 03:51.430
So while this is running, we can also double check that the Docker image has been pushed and we have

03:51.430 --> 03:53.870
a new tag for the new updated image.

03:54.150 --> 03:55.590
So let's refresh this.

03:57.590 --> 04:02.310
And as you can see here we have the latest image with the new latest tags.

04:05.990 --> 04:09.590
And same as before we also have a success for both jobs.

04:10.510 --> 04:11.070
So like this.

04:11.070 --> 04:15.870
We have covered both automated and manual triggering of our CI CD pipeline.

04:15.870 --> 04:19.350
And with that we can wrap up the CI CD portion.

04:19.350 --> 04:21.630
And we also can conclude this course.
