Search⌘ K
AI Features

Set Up GitHub Actions

Explore how to set up a continuous deployment pipeline with GitHub Actions to deploy your web service only when pull requests merge into master. You will learn to create and configure workflow files, manage dependencies, and securely use Firebase tokens for automated deployments, helping you streamline your CI/CD process.

Requirements

Before you set up GitHub Actions or write the workflow configuration, it’s a good idea to define the requirements of what we want to achieve in this lesson:

  1. Deploy only when a pull request is merged into the master branch.
  2. Use the deploy script in services/web/package.json.

Setting up GitHub Actions

There are two ways to get started with GitHub Actions with a web interface:

  1. Click the “Actions” tab on your repository page. It allows you to visually select existing workflows. This is an easy way to get started if you want to experiment.

  2. Define the workflow in the source code at .github/workflows/. In our case, we will follow this.

Now, connect to the terminal given below and follow these steps:

  1. Let’s start with creating a new branch:
git switch -c add-deployment-github-action
  1. The demo.yml workflow file is a placeholder we inherited from the monorepo-template we started with. The workflow itself doesn’t do anything other than printing a few sentences to the console. It is meant as a
...