We can utilise GitHub Actions to automatically deploy when we push something.

We managed to set up different environments for development and production, with the same crucial settings for both projects, but there is one concern left. At this point, we need to manually deploy to the development or production project. Firstly, we can easily forget to deploy. Secondly, we might accidentally deploy to the wrong project. If for some reason, the concept of Continous Integration and Continous Delivery is new, it is perfectly summed up by Jeff Delaney in under 2 minutes.

We can utilize GitHub Actions to automatically deploy on every push. We want to have an automatic build and deployment for production every time we push something.

In our repository’s /.github/workflows folder, create a file called deploy@master.yml. The script below does exactly what we want to do on the master:

  • Creates a Ubuntu VM
  • Sets up Node on it
  • Retrieves dependencies from the cache, if it is possible
  • Install the project’s dependencies
  • Runs unit tests
  • Builds the project
  • Deploys it to Firebase, both to my master and dev environment

#github #angular #firebase

CI/CD for Angular Projects with Firebase and Github Actions
4.20 GEEK