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
705 stars 202 forks source link

[BUG] npm ERR! code ELIFECYCLE npm ERR! errno 1 when running GitHub action to deploy to website on push to master branch. #100

Closed andrewkirima closed 3 years ago

andrewkirima commented 3 years ago

Action config

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

name: Deploy to Live Channel
'on':
  push:
    branches:
      - master
jobs:
  build_and_deploy_to_live_website:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout branch
        uses: actions/checkout@v2

      - name: Install dependencies & build
        run: npm ci && npm run build

      - name: Deploy to Firebase
        uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: '${{ secrets.GITHUB_TOKEN }}'
          firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_MYPROJECT }}'
          channelId: live
          projectId: myproject
        env:
          FIREBASE_CLI_PREVIEWS: hostingchannels

Error message

Run npm ci && npm run build
npm WARN prepare removing existing node_modules/ before installation

> core-js@2.6.11 postinstall /home/runner/work/sencha-web/sencha-web/node_modules/babel-runtime/node_modules/core-js
> node -e "try***require('./postinstall')***catch(e)***"

> fsevents@1.2.13 install /home/runner/work/sencha-web/sencha-web/node_modules/waitlistapi/node_modules/chokidar/node_modules/fsevents
> node install.js

Skipping 'fsevents' build as platform linux is not supported

> fsevents@1.2.13 install /home/runner/work/sencha-web/sencha-web/node_modules/watchpack-chokidar2/node_modules/fsevents
> node install.js

Skipping 'fsevents' build as platform linux is not supported

> core-js@3.6.4 postinstall /home/runner/work/sencha-web/sencha-web/node_modules/core-js
> node -e "try***require('./postinstall')***catch(e)***"

> fsevents@1.2.12 install /home/runner/work/sencha-web/sencha-web/node_modules/jest-haste-map/node_modules/fsevents
> node-gyp rebuild

make: Entering directory '/home/runner/work/sencha-web/sencha-web/node_modules/jest-haste-map/node_modules/fsevents/build'
  SOLINK_MODULE(target) Release/obj.target/.node
  COPY Release/.node
make: Leaving directory '/home/runner/work/sencha-web/sencha-web/node_modules/jest-haste-map/node_modules/fsevents/build'

> core-js-pure@3.6.4 postinstall /home/runner/work/sencha-web/sencha-web/node_modules/core-js-pure
> node -e "try***require('./postinstall')***catch(e)***"

> fsevents@1.2.11 install /home/runner/work/sencha-web/sencha-web/node_modules/webpack-dev-server/node_modules/fsevents
> node-gyp rebuild

make: Entering directory '/home/runner/work/sencha-web/sencha-web/node_modules/webpack-dev-server/node_modules/fsevents/build'
  SOLINK_MODULE(target) Release/obj.target/.node
  COPY Release/.node
make: Leaving directory '/home/runner/work/sencha-web/sencha-web/node_modules/webpack-dev-server/node_modules/fsevents/build'

> node-sass@4.14.1 install /home/runner/work/sencha-web/sencha-web/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-83_binding.node
Download complete
Binary saved to /home/runner/work/sencha-web/sencha-web/node_modules/node-sass/vendor/linux-x64-83/binding.node
Caching binary to /home/runner/.npm/_cacache/node-sass/4.14.1/linux-x64-83_binding.node

> node-sass@4.14.1 postinstall /home/runner/work/sencha-web/sencha-web/node_modules/node-sass
> node scripts/build.js

Binary found at /home/runner/work/sencha-web/sencha-web/node_modules/node-sass/vendor/linux-x64-83/binding.node
Testing binary
Binary is fine

> core-js@3.6.5 postinstall /home/runner/work/sencha-web/sencha-web/node_modules/@firebase/polyfill/node_modules/core-js
> node -e "try***require('./postinstall')***catch(e)***"

> protobufjs@6.10.2 postinstall /home/runner/work/sencha-web/sencha-web/node_modules/protobufjs
> node scripts/postinstall

added 2116 packages in 39.928s

> sencha-web@0.1.0 build /home/runner/work/sencha-web/sencha-web
> react-scripts build && mv build/index.html build/app.html

Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`

Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.

Failed to compile.

./src/components/Footer/Footer.js
  Line 158:19:  The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid

./src/components/Navbar/Navbar.js
  Line 3:8:     'facebook' is defined but never used                                                                                                                                                                                                                                                                                                                                     no-unused-vars
  Line 4:8:     'instagram' is defined but never used                                                                                                                                                                                                                                                                                                                                    no-unused-vars
  Line 5:8:     'linkedin' is defined but never used                                                                                                                                                                                                                                                                                                                                     no-unused-vars
  Line 6:8:     'twitter' is defined but never used                                                                                                                                                                                                                                                                                                                                      no-unused-vars
  Line 138:17:  The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid

./src/components/Header/Header.js
  Line 6:8:  'newsletterCover' is defined but never used  no-unused-vars

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sencha-web@0.1.0 build: `react-scripts build && mv build/index.html build/app.html`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sencha-web@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-03-18T17_52_02_617Z-debug.log
Error: Process completed with exit code 1.

Expected behavior

Run through the entire workflow and deploy when I push to the master repo.

Actual behavior

Fails at the Install dependencies & build part of my GitHub action

samtstern commented 3 years ago

@andrewkirima a screenshot of the last few lines of the error message is not enough to debug this, can you show the full error logs from that step?

andrewkirima commented 3 years ago

@andrewkirima a screenshot of the last few lines of the error message is not enough to debug this, can you show the full error logs from that step?

I updated my post to show the entire error log for that particular step in the job.

samtstern commented 3 years ago

@andrewkirima the issue is coming from your build and is not related to Firebase, see the logs:

> sencha-web@0.1.0 build /home/runner/work/sencha-web/sencha-web
> react-scripts build && mv build/index.html build/app.html

Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`

Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.

Failed to compile.

./src/components/Footer/Footer.js
  Line 158:19:  The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid

./src/components/Navbar/Navbar.js
  Line 3:8:     'facebook' is defined but never used                                                                                                                                                                                                                                                                                                                                     no-unused-vars
  Line 4:8:     'instagram' is defined but never used                                                                                                                                                                                                                                                                                                                                    no-unused-vars
  Line 5:8:     'linkedin' is defined but never used                                                                                                                                                                                                                                                                                                                                     no-unused-vars
  Line 6:8:     'twitter' is defined but never used                                                                                                                                                                                                                                                                                                                                      no-unused-vars
  Line 138:17:  The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md  jsx-a11y/anchor-is-valid

./src/components/Header/Header.js
  Line 6:8:  'newsletterCover' is defined but never used  no-unused-vars

Looks like you have some simple lint errors which are stopping your build. You probably did not notice these in development because they might have been classified as warnings.

If you run npm run build on your own machine you should be able to see these same logs and fix them.

andrewkirima commented 3 years ago

Thanks big time @samtstern ! It worked. The whole time I've been having that issue but I didn't think it was a problem because it would always work when I ran yarn run build to deploy from my local machine.