Skip to content

Deploy Angular to Production with Github Actions

Posted in Javascript, and Server

Github Actions is cool. Angular is the best. Deploy your Angular application with Github Actions. Here’s how

To create your Github action, you can go here: https://github.com/your-github-username/your-repository/actions

Create a blank workflow, and copy paste the section below

For the above workflow to work, the last step is to add the contents of your ~/.ssh/id_rsa to https://github.com/your-username/repository-name/settings/secrets

That way, the KEY: ${{ secrets.forSSH }} part will work. Remember to name it forSSH or anything you like, and change it accordingly in the above workflow script.

That way, the above will copy the contents after the build looks like this

The destination folder is /home/user/domain.com/pwa

The source folder, which is the temporal project folder created by github during the actions is ./dist/your-project name

I hope the above helps. Happy coding!