Deploying with GitHub Actions

Tamrakar Shreyaa
3 min readMar 29, 2023

This article provides a detailed guide for setting up a simple CI/CD pipeline with Github Actions .

What is CI/CD Pipeline?

To implement Continuous Integration and Continuous Deployment for your project, you will need to set up pipelines. In simple terms, a pipeline consists of two main parts: a trigger event and a sequence of actions executed after the trigger event happens.

The trigger can be any event, like making a pull request, merging one branch into another, creating a new branch, or pushing a commit to the repository. If needed, you may also define custom trigger endpoints.

CI/CD pipeline with Github Actions

Deploying an application with Git actions involves setting up automated workflows that are triggered by events in a Git repository.

To configure Git actions,it’s important to have a few prerequisites in place. Firstly, a basic understanding of Git and YAML is necessary. Additionally, you will need access to at least one Git repository and an SFTP server.

Create two folders in the project: First, create .github folder and put the .workflows folder in the .github. Next, you should create a file in .workflows. (you can name it whatever you want, but it should be clear). So let’s create the yml file called github-actions-demo.yml.

Write the following configuration in this file:

So let’s explain the process in sections:

First, here is declared which event triggers the Github Actions workflow.

In this case, the Github Actions workflow will run on the deploy branch on any push(commit, merge, etc…) event.

We tell our job what operating system should be set up, which will run the Github Actions workflow.

We are using SamKirkland/FTP-Deploy-Action@2.0.0 ,yml file may differ depending on what package or which version you use

--

--

Tamrakar Shreyaa

Laravel | PHP | API | AJAX | jQuery | Laravel vue | Livewire | LAMP stack | CI CD