Github Actions Angular-cli

3

一个项目已经被创建并放置在Github上。我试图探索使用Github Actions构建Angular-cli项目。

Github Action的.yml文件如下所示,

  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

在构建过程中出现以下错误:

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.
2个回答

3

看起来你在Github Actions和部署方面还比较新。根据我的经验,我猜测你已经开始安装Angular-CLI了,因为在操作流程中出现了ng未找到的问题。

- 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

修复细节:先安装Node,然后尝试npm install和npm build


-1

我在GitHub市场上使用了Angular Deploy gh-pages Actions GitHub操作来设置GitHub中的Angular。

这是我的main.yml文件。

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/angular-deploy-gh-pages-actions@v1.3.1 
      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 

这里是在GitHub中设置Angular应用程序的详细步骤

逐步说明在此处


这看起来更像是广告而不是真正的答案。 - Hoang Duc Nguyen

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接