How to Set Up GitHub Actions Checkout, Simple Guide for Beginners!

You can build unique, automated software development workflows (including CI/CD) right inside your GitHub repository with the help of GitHub Actions. Let’s say we have a GitHub repository.

Different types of events, such as starring, pull requests, and issue creation, can occur in that repository. These events can be used to start an automated workflow. GitHub is able to launch one or more containers for us in the cloud and carry out instructions to perform useful tasks.

Table of Content

Things You Should Know About GitHub Actions Checkout

  • GitHub will track each step’s progress and make it crystal clear if anything went wrong.
  • The benefit of GitHub Actions is that we can use the community-implemented steps rather than having to write them ourselves.
  • A workflow can be made by writing individual tasks, or actions, and then combining them.
  • You can set up workflows in your repository to automatically build, test, package, release, and deploy any project on GitHub.
  • By writing custom code that interacts with your repository however you like, you can create actions. For instance, an action can publish npm modules, send Slack updates, or deploy code that is ready for production.
  • To carry out practical tasks like CI/CD, publish to NPM, deploy to Azure/AWS, and more, you can use GitHub Actions.

Introduction to GitHub Actions

Go to the Actions tab in any repository where you want to create a workflow.

  • Choose a workflow from the ones offered or start from scratch.
  • Create a.yml file in the path.github/workflows/action1.yml to create your own workflow. When you commit the file, GitHub will recognize that it is a workflow.
  • After setting it up, you can check your workflow logs in the same Actions tab.
See Also  How to Get a GitHub Access Token for Personal Access

How to design unique actions for typical applications

The whole point of continuous integration (CI) is to have developers submit small, easily maintainable chunks of their code to the main codebase on a daily basis. The primary codebase ought to be automatically tested against those modifications.

Although this tutorial uses a straightforward node project, you are free to use your own.

  • Make a new action.yml file in the .github/workflows directory.
name: Node Continuous Integration



        branches: [ master ]



        runs-on: ubuntu-latest


            - uses: actions/checkout@v2

            - uses: actions/setup-node@v1


                node-version: 12

            - run: npm ci

            - run: npm test

            - run: npm run build

As a result of the action described above,
  • You have created a Node Continuous Integration action.
  • When there is a pull request on the master branch, this action is initiated. The action’s precipitating event is described below on:
  • There are one or more jobs for an action. The initial action is as follows:
opens a virtual machine running Ubuntu.
  • actions/checkout@v2 the source code is brought to the active working directory. An existing GitHub action is checkout@v2.
sets up node.
  • utilizes npm ci to install app dependencies.
  • The npm test and npm run build commands run the test script specified in package.json. We can use our preferred libraries, such as jest and webpack, with these commands.

A green checkmark or a red “x” is displayed in the repository’s actions tab log if there are any errors or build failures.

Continuous Deployment

We also want to deploy the application to production after we merge the code from your valid pull request into the master branch. Continuous deployment involves sending that code to the production environment.

See Also  How to Download Android Source Code for GitHub

You can use the github-pages action if your website is hosted on GitHub. However, options like SFTP, FTP, and SSH are available if a third-party provider hosts your app. This is fine when we do it manually, but using a CD tool makes it more difficult. For the CD procedure, we will have to divulge a secret token to GitHub.

See how to deploy to a firebase below:

   firebase init

    firebase deploy --only-hosting


    firebase login:ci

This gives us a private token that we can give to GitHub. Navigate to the GitHub repository’s settings tab. A new FIREBASE TOKEN secret should be made.

name: Firebase CD



        branches: [ master ]



        runs-on: ubuntu-latest


            - uses: actions/checkout@master

            - uses: action/setup-node@master


              node-version: 12

            - run: npm ci

            - run: npm run build

            - uses: w9jds/firebase-action@master


                args: deploy --only-hosting


                  FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}   

The preceding action deploys our application to Firebase whenever changes are pushed to the master branch. Above w9jds/firebase-action@master is a GitHub-hosted action developed by a third party.


  • There are numerous CI tools available, including Jenkins, Travis CI, and Circle Ci. Jenkins is a self-hosted automation server, while GitHub actions are SaaS. (SaaS).
  • For open-source repositories, GitHub Actions is free, and private repositories have a free limit. GitHub Actions incorporates CI into the ecosystem of GitHub.
  • When migrating your repository to a different Git platform without rewriting the entire CI process, using an external CI tool such as Travis is helpful.

Share This Post

Newest Articles

How to Get a GitHub Access Token for Personal Access

No longer have access to your personal GitHub repository? You can use the GitHub Access Token to open it. Read the full guide here!

How to Make a GitHub Repository Private

Developers can now create a private GitHub repository in the free tier as of January 7, 2019. Read how to get the private repository feature on GitHub here!

3 Methods of How to Install Android SDK Repository

Android is one of the most used operating systems for software development. Read the full guide on how to get the Android SDK here!

How to Turn Off Android Developer Mode

Android Developer Options allows you to access hidden features. If you want to deactivate it, follow this simple guide to turn it off!

5 Simple Ways How to Get Cookie Clicker GitHub

How to get and use Cookie Clicker on GitHub? You can find the simple steps and cheats for Cookie Clicker in this article!

How to Integrate Jira with GitHub in 6 Easy Steps

If you use Jira for your work and need to integrate with another organization that uses GitHub, integration is what you require. Read the details here!