GitHub Actions CI/CD Tutorial Series — Part 6
In Part 5 of this tutorial series, we covered the following steps:
*) Added GitHub Secrets
*) Created the Docker Compose and .env
file
*) Finished cicd.yml
file
*) Changed something Backend code to trigger build pipeline
If you missed Part 5, you can find it here: Part 5
We stopped at the build process of the app
As you can see the build was successful, now we can merge the branch backend-changes-v3
into master
. In order to achieve that go again to “Pull requests” and click on “Merge pull request”:
Then click on “Confirm merge”:
Hop on the tab “Actions”:
There you should see a running workflow, you can also click on that workflow:
Then you should see first running the build job and then the deploy job:
The build job went successful but the deploy job failed, so so click on “Deploy Project”:
You should see at the end an error message which says: “docker.errors.DockerException: Error while fetching server API version: (‘Connection aborted.’, PermissionError(13, ‘Permission denied’))
Error: Process completed with exit code 1.”
Seems that permission is missing so connect to your server with SSH again:
ssh {your-user}@{your-linode-ip} -p 1022
Enter this command (source: StackOverflow):
sudo chmod 666 /var/run/docker.sock
Next, make sure nothing runs on port 9090
:
sudo netstat -tunlp
Terminate the Node demo application by using the PID 1418
:
sudo kill -9 1418
Now, you can log out from your server and jump back to GitHub Actions and there you can click on “Re-run all jobs”:
Now, both jobs should finish successfully:
Lastly, check it in your web browser:
https://task-manager.{your-domain}/api/v1/tasks
And that’s it for this tutorial series.
Congratulations | Mabrook | مبروك you have completed the ENTIRE TUTORIAL SERIES!!!
You should be proud of yourself! If you enjoyed this article, give it a clap.
You can also check out the article in video format on YouTube at: https://www.youtube.com/@habibicoding.