Tom Cockram
Tom Cockram

Reputation: 227

Angular build not compiled correctly GitHub Actions

I am using GitHub actions to create a release build when a tag gets pushed. However, once it runs and I check the releases tab it hasn’t created the release correctly. Normally when you run ng build --prod it compiles all of your code into a few files reducing the file size massively. When I download the project from the releases tab it’s just normal like I would view it in a file explorer.

This is my workflow yaml file:

name: dev-release

on:

  create:

    tags:

      - v*

jobs:

  build:

    name: setup environment

    runs-on: ubuntu-latest

    strategy:

      matrix:

        node-version: [12.x]

    steps:

      - uses: actions/checkout@v2

        with:

          fetch-depth: 0

      - name: Cache node modules

        uses: actions/[email protected]

        with:

          path: ~/.npm

          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

          restore-keys: |

            ${{ runner.os }}-node-

      - name: Node ${{ matrix.node-version }}

        uses: actions/[email protected]

        with:

          node-version: ${{ matrix.node-version }}

      - name: npm install

        run: |

          npm i

          npm run build:ci

      - name: Create Release

        uses: ncipollo/release-action@v1

        with:

          token: ${{ secrets.TOKEN }}

          draft: true

Upvotes: 0

Views: 332

Answers (1)

Krzysztof Madej
Krzysztof Madej

Reputation: 40603

Plese define artifacts in ncipollo/release-action@v1 to you folder as

artifacts: An optional set of paths representing artifacts to upload to the release. This may be a single path or a comma delimited list of paths (or globs).

Looking at logs all seems to be fine because code was compiled:

2020-11-18T11:01:59.5831738Z chunk {} runtime.1d195ead05122679a08a.js (runtime) 2.3 kB [entry] [rendered]
2020-11-18T11:01:59.5832939Z chunk {1} 1.c16b36d40a2635ee97c6.js () 174 kB  [rendered]
2020-11-18T11:01:59.5833729Z chunk {2} 2.5449d2e89a98cbd134fb.js () 37.2 kB  [rendered]
2020-11-18T11:01:59.5834534Z chunk {3} 3.fe05023c0dd4c02292ef.js () 53.6 kB  [rendered]
2020-11-18T11:01:59.5835659Z chunk {4} light.blue.yale.a040718431090d476d1d.css (light.blue.yale) 168 kB [initial] [rendered]
2020-11-18T11:01:59.5836819Z chunk {5} main.38262ff03d42f24493fc.js (main) 1.32 MB [initial] [rendered]
2020-11-18T11:01:59.5837887Z chunk {6} polyfills.55cc3ce773551d941d32.js (polyfills) 36 kB [initial] [rendered]
2020-11-18T11:01:59.5839256Z chunk {7} styles.d3fcf7ce8fd057dbb140.css (styles) 305 kB [initial] [rendered]
2020-11-18T11:01:59.5840306Z chunk {8} 8.e0c916486616e1903c4b.js () 275 kB  [rendered]

Upvotes: 1

Related Questions