I have a PWA project based on Ionic Angular. I want to use GitHub Actions, so that when I push the changes, my projects get built and deployed on Google Firebase Hosting.
In prepared package.json with specification of "build-prod": "ionic build --prod".
And in my main.yml file I specified the steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build-prod
Install Dependencies step went well. However, GitHub Actions showed an error on Build step:
Run npm run build-prod
> my-project@0.0.1 build-prod /home/runner/work/my-project/my-project
> ionic build --prod
sh: 1: ionic: not found
As I have understood the simple reason is that GitHub Actions did not know what ionic was. However, when I tried to use
- name: Build
run: npm run build
which by default used: ng build, GitHub Actions managed to executed the Build step successfully.
When I used ng build --prod success was also observed.
However, I need to execute ionic build --prod command. And therefore, I wanted to know what is the difference between ionic build and ng build? Will execution of this commands result in the same output, or does ionic build do different things than ng build do?
I must add, that when I run ionic build --prod, my console prints the following message: ng.cmd run app:build:production
Could this message give some clue to my problem solution for making an ionic production build with GitHub Actions?