newAngs
newAngs

Reputation: 133

Github Actions Angular-cli

A project has been created and placed on Github. I was trying to explore the Github Actions, with building Angular-cli projects.

The .yml file for githubAction is as follows,

  steps:
        - uses: actions/checkout@v1
        - name: Install NPM
          run:  npm install
        - name: Update Npm
          run:  npm update
        - name: Typescript compiler
          uses: iCrawl/action-tsc@v1
        - name: NpM angular CLI 
          uses: npm install angular-cli
        - name: Build
          run:  npm build

Then while building gets the following error,

The pipeline is not valid. .github/workflows/main.yml (Line: 19, Col: 13): Expected format {org}/{repo}[/path]@ref. Actual 'npm install angular-cli',Input string was not in a correct format.

Upvotes: 5

Views: 4961

Answers (2)

Shankar Ganesh Jayaraman
Shankar Ganesh Jayaraman

Reputation: 1481

I have used Angular Deploy gh-pages Actions GitHub action from the marketplace for setting up Angular in GitHub.

Here is my main.yml file

name: Host Angular app in GitHub 
on:
  push:
    branches:
      - master
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Building and Deploying...
      uses: AhsanAyaz/[email protected] 
      with:
        github_access_token: ${{ secrets.ACCESS_TOKEN }} 
        build_configuration: production 
        base_href: /shopping-cart/  
        deploy_branch: gh-pages 
        angular_dist_build_folder: dist/shopping-cart 

Here are the detailed steps for setting up Angular application in GitHub.

Step by Step instructions here.

Upvotes: -1

rams
rams

Reputation: 359

you seems to be new in Github Actions and deployments. With my experience, I assume you have reached the point of install Angular-CLI, due to ng not found issues occurred in action flow.

- uses: actions/checkout@v1
- name: Install Node
  uses: actions/setup-node@v1
     with:
        node-version: 12.8
- name: npm dependencies
   run: npm install     
- name: Build
   run: npm run build -- --prod

Fix Detail: Install Node first and then try npm install and npm build

Upvotes: 7

Related Questions