Top 10 GitHub Actions You Should Use to set up your CI/CD Pipeline

GitHub announced GitHub Actions in late 2018 as a new CI/CD platform where users can automate workflows and build development cycles.

The best part of the actions is that they are event-driven. Events in a GitHub repository can trigger actions to run …


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Ismail Egilmez

GitHub announced GitHub Actions in late 2018 as a new CI/CD platform where users can automate workflows and build development cycles.

The best part of the actions is that they are event-driven. Events in a GitHub repository can trigger actions to run on-demand workflows.

image2

In this article, I listed the top 10 GitHub Actions that are really useful for the developer community while setting up a CI/CD pipeline.

1. Setup

image3

There are a lot of actions called Setup which allow you to set up your GitHub workflows with the programming language of your choice. Most of the setup actions are used for downloading and setting up a requested version of the runtime.

The most popular ones are Node.js, Python, Java JDK, Go, .Net Core SDK.

2. Checkout

image4

Checkout downloads your Git repository in your local environment to let your workflow access it and it checks out your target repository to run the GitHub actions on top of it.

There are a lot of scenarios that you can make with Checkout. You can push a commit using the built-in token or fetch all history for all tags and branches are only two scenarios.

3. Cache

image5

Using Cache action, you don’t have to download frequently used dependencies anymore. It allows caching dependencies and builds outputs to improve workflow execution time.

The cache is very useful while building a CI/CD pipeline by cost-saving and freeing up network utilization.

4. Upload Artifact

image6

Sharing data between jobs is a lot of work. Upload Artifact action automates this hard work and enables you to upload your artifacts from your workflow allowing you to share data between jobs and store data once a workflow is complete.

Be cautious that if your workflow uploads a high number of artifacts in a short period of time, you may see them blocked due to exceeding usage.

But to overcome this, you can reduce the number of HTTP calls made during artifact upload by zipping or archiving the contents of your artifact before an upload starts.

5. Download Artifact

image 7

The Download Artifact action downloads artifacts from your build in your GitHub repository.

You can either download a single artifact or all artifacts at once with this action. The action provides an output parameter for the download path to ease the use.

6. Create Pull Request

image8

Create Pull Request GitHub action creates a pull request for changes to your repository.

This is a really useful action to use along with other actions that add or modify files to your repositories. Create Pull Request action automatically commits the changes to a new branch and creates a pull request.

7. Automerge

image8

Merge pull requests Github action automatically merges pull requests when they are ready to go. It adds an auto merge label on the pull requests and runs its tasks.

The action grabs the changes from the base branch and when the pull request is ready, it automatically merges into the pull request.

One last note; the branch created by the action will not be deleted after the pull request has been merged successfully. You need to use some automatic deletion actions for cleaning up.

8. Docker Build & Push Action

image9

Docker build and push action creates a Docker image and pushes it to a registry that you choose such as GitHub Docker Registry, Docker Hub, GCR, or AWS ECR.

You can do many things with this action. For example, you can share built images between jobs. In other words, you can pass data between jobs in a workflow.

Many other useful automation actions are available with this action. You can copy Docker images between registries without changing the image SHA. You can export images to Docker if you want your build result available in Docker. You can build multi-platform images, you can handle tags and labels, and more.

9. Slack

image11

Slack Notify GitHub Action is a great automation piece for notification.

Let’s take an open-source project as an example, there might be a lot of contributors who don’t know each other.

And when you integrate such a notification tool inside your workflows, you can notify project contributors about your new commits inside Slack.

10. Foresight

Foresight GitHub app enables you to monitor and troubleshoot your GitHub Actions CI workflows, tests, builds, and jobs.

One of the most important and underestimated parts of a CI/CD pipeline is the monitoring part. With Foresight, you can monitor your workflows’ resource usage metrics, understand workflow costs, duration, success & failure rates, jobs with high failure rates, and more.

Visit Foresight for more information.

These GitHub actions aim to automate parts of your CI/CD pipeline. There are thousands of GitHub actions available for helping to automate some workflows.

image15

Summing up, GitHub Actions is an invaluable tool to design automated workflows only limited with your imagination. I want to close this article by stressing the importance of observability in continuous integration and continuous deployment pipelines.

Being able to see the metrics of all of your workflows consolidated in a single dashboard is something needed. When a build fails, having the toolkit dive into test code and replay it line by line is a cherry on top. Or seeing a trace map of all the dependencies of your tested application is kind of a double cherry on top!

Save the date! 🕊️
On the 28th of September, we are launching Foresight on Product Hunt 🎉🍻
Take your seat before we launch on Product Hunt đź’ś


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Ismail Egilmez


Print Share Comment Cite Upload Translate Updates
APA

Ismail Egilmez | Sciencx (2022-09-12T13:34:25+00:00) Top 10 GitHub Actions You Should Use to set up your CI/CD Pipeline. Retrieved from https://www.scien.cx/2022/09/12/top-10-github-actions-you-should-use-to-set-up-your-ci-cd-pipeline/

MLA
" » Top 10 GitHub Actions You Should Use to set up your CI/CD Pipeline." Ismail Egilmez | Sciencx - Monday September 12, 2022, https://www.scien.cx/2022/09/12/top-10-github-actions-you-should-use-to-set-up-your-ci-cd-pipeline/
HARVARD
Ismail Egilmez | Sciencx Monday September 12, 2022 » Top 10 GitHub Actions You Should Use to set up your CI/CD Pipeline., viewed ,<https://www.scien.cx/2022/09/12/top-10-github-actions-you-should-use-to-set-up-your-ci-cd-pipeline/>
VANCOUVER
Ismail Egilmez | Sciencx - » Top 10 GitHub Actions You Should Use to set up your CI/CD Pipeline. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/09/12/top-10-github-actions-you-should-use-to-set-up-your-ci-cd-pipeline/
CHICAGO
" » Top 10 GitHub Actions You Should Use to set up your CI/CD Pipeline." Ismail Egilmez | Sciencx - Accessed . https://www.scien.cx/2022/09/12/top-10-github-actions-you-should-use-to-set-up-your-ci-cd-pipeline/
IEEE
" » Top 10 GitHub Actions You Should Use to set up your CI/CD Pipeline." Ismail Egilmez | Sciencx [Online]. Available: https://www.scien.cx/2022/09/12/top-10-github-actions-you-should-use-to-set-up-your-ci-cd-pipeline/. [Accessed: ]
rf:citation
» Top 10 GitHub Actions You Should Use to set up your CI/CD Pipeline | Ismail Egilmez | Sciencx | https://www.scien.cx/2022/09/12/top-10-github-actions-you-should-use-to-set-up-your-ci-cd-pipeline/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.