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.
We'll cover the following...
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:
- Deploy only when a pull request is merged into the master branch.
- 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:
-
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.
-
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:
- Let’s start with creating a new branch:
git switch -c add-deployment-github-action
- The
demo.ymlworkflow 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