FirebaseExtended / action-hosting-deploy

Automatically deploy shareable previews for your Firebase Hosting sites
https://firebase.google.com/docs/hosting/github-integration
Apache License 2.0
695 stars 202 forks source link

[BUG] #300

Open popecj29 opened 1 year ago

popecj29 commented 1 year ago

Action config

Error message

Run npm run build

pawsh@0.0.0 build ng build

sh: 1: ng: not found Error: Process completed with exit code 127.

Expected behavior

it should deploy to my firebase hosting and update the app with the new content.

Actual behavior

the action bombs out and says it can't find angular see above.

popecj29 commented 1 year ago

This is the whole error log

Run npm i & npm run build

pawsh@0.0.0 build ng build

sh: 1: ng: not found npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @angular/fire@7.0.4 npm ERR! Found: @angular/common@15.2.5 npm ERR! node_modules/@angular/common npm ERR! @angular/common@"^15.2.0" from the root project npm ERR! peer @angular/common@"15.2.5" from @angular/forms@15.2.5 npm ERR! node_modules/@angular/forms npm ERR! @angular/forms@"^15.2.0" from the root project npm ERR! peer @angular/forms@"^15.0.0" from @ng-bootstrap/ng-bootstrap@14.1.0 npm ERR! node_modules/@ng-bootstrap/ng-bootstrap npm ERR! @ng-bootstrap/ng-bootstrap@"^14.1.0" from the root project npm ERR! 4 more (@angular/platform-browser, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @angular/common@"^12.0.0" from @angular/fire@7.0.4 npm ERR! node_modules/@angular/fire npm ERR! @angular/fire@"^7.0.4" from the root project npm ERR! npm ERR! Conflicting peer dependency: @angular/common@12.2.17 npm ERR! node_modules/@angular/common npm ERR! peer @angular/common@"^12.0.0" from @angular/fire@7.0.4 npm ERR! node_modules/@angular/fire npm ERR! @angular/fire@"^7.0.4" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! /home/runner/.npm/_logs/2023-07-28T02_22_41_480Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /home/runner/.npm/_logs/2023-07-28T02_22_41_480Z-debug-0.log Error: Process completed with exit code 127.

popecj29 commented 1 year ago

this is the workflow file that was generated by firebase, i did not alter it from its default

This file was auto-generated by the Firebase CLI

https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge 'on': push: branches:

marijnbos commented 1 year ago

Heya, It could be that the GitHub action cannot find the project folder if your file structure is something like this: |- project folder

to fix this you can add a working directory on the run and an entry point in the with clause. Does this fix the issue on your end?

Here is an example workflow:

# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
'on':
  push:
    branches:
      - main
      - development
jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - run: npm ci && npm run build
        working-directory: ./projectname(case sensitive)
      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          projectId: ###
          entrypoint: './projectname(possibly case sensitive)'
        env:
            FIREBASE_CLI_EXPERIMENTS: webframeworks <- Also something I needed to add for support of angular
popecj29 commented 1 year ago

I'll try it, I will say that this worked just fine with no issues a month or so ago.