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] Issue while trying to deploy the preview on push using yarn as a runner of own steps before the deployment #173

Open keriat opened 2 years ago

keriat commented 2 years ago

Action config

jobs:
  build_and_deploy:
    if: '${{ github.event.repository.full_name == github.repository }}'
    runs-on: ubuntu-latest
    environment: dev
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: 14.17.3

      - uses: c-hive/gha-yarn-cache@v2 # using cache

      - name: "Step #1: Installing dependencies"
        run: yarn install

      - name: "Step #2: Configuring rinkeby env"
        run: yarn run ci:build:rinkeby

      - name: "Step #3: Deploying to the staging the latest valid code"
        uses: matter-labs/action-hosting-deploy@v0
        with:
          repoToken: '${{ secrets.GITHUB_TOKEN }}'
          firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_DAPP_CHECKOUT_DEV }}'
          target: staging
          projectId: zsync-dapp-checkout
          channelID: live

Expected behavior

  1. Regular deploy without errors in the GitHub Action runs logs
  2. Correct access to the deployed code at the both domains: *.dev.app & *.firebaseapp.com

Actual behavior

Major issue is halfly-successfull deploy & constant errors in log after the end of GitHub Action.

Referrers Issue #1234 reported here

Same issue for me.

My case

Error message

As the result I'm constantly getting errors in log though the action is finishing oksee the screenshoot

2021-11-23T19:16:32.8596166Z [command]/opt/hostedtoolcache/node/14.17.3/x64/bin/npx firebase-tools deploy --only hosting:staging --project zsync-dapp-checkout --json
2021-11-23T19:17:10.2551752Z npm ERR! code ENOENT
2021-11-23T19:17:10.2556950Z npm ERR! syscall open
2021-11-23T19:17:10.2557976Z npm ERR! path null/package.json
2021-11-23T19:17:10.2559827Z npm ERR! errno -2
2021-11-23T19:17:10.2575443Z npm ERR! enoent ENOENT: no such file or directory, open 'null/package.json'
2021-11-23T19:17:10.2577417Z npm ERR! enoent This is related to npm not being able to find a file.
2021-11-23T19:17:10.2578685Z npm ERR! enoent 
2021-11-23T19:17:10.2601964Z ***
2021-11-23T19:17:10.2602841Z   "error": ***
2021-11-23T19:17:10.2603632Z     "code": "ENOENT",
2021-11-23T19:17:10.2605003Z     "summary": "ENOENT: no such file or directory, open 'null/package.json'",
2021-11-23T19:17:10.2606642Z     "detail": "This is related to npm not being able to find a file.\n"
2021-11-23T19:17:10.2607565Z   ***
2021-11-23T19:17:10.2608457Z ***
2021-11-23T19:17:10.2636754Z 
2021-11-23T19:17:10.2637803Z npm ERR! A complete log of this run can be found in:
2021-11-23T19:17:10.2639319Z npm ERR!     /home/runner/.npm/_logs/2021-11-23T19_17_10_258Z-debug.log
2021-11-23T19:17:10.2688453Z (node:2961) UnhandledPromiseRejectionWarning: 254
2021-11-23T19:17:10.2690330Z (Use `node --trace-warnings ...` to show where the warning was created)
2021-11-23T19:17:10.2694900Z (node:2961) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
2021-11-23T19:17:10.2699525Z (node:2961) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2021-11-23T19:17:17.6960730Z ***
2021-11-23T19:17:17.6961986Z   "status": "success",
2021-11-23T19:17:17.6962933Z   "result": ***
2021-11-23T19:17:17.6964861Z     "hosting": "sites/staging-checkout-v1-zksync/versions/b54050fe895987c6"
2021-11-23T19:17:17.6966685Z   ***
2021-11-23T19:17:17.6967432Z ***
2021-11-23T19:17:19.0772393Z ##[endgroup]
2021-11-23T19:17:19.0789601Z ***
2021-11-23T19:17:19.0791766Z   details_url: 'https://zsync-dapp-checkout.web.app/',
2021-11-23T19:17:19.0793382Z   conclusion: 'success',
2021-11-23T19:17:19.0794352Z   output: ***
2021-11-23T19:17:19.0795902Z     title: 'Production deploy succeeded',
2021-11-23T19:17:19.0805223Z     summary: '[zsync-dapp-checkout.web.app](https://zsync-dapp-checkout.web.app/)'
2021-11-23T19:17:19.0806414Z   ***
2021-11-23T19:17:19.0807305Z ***

Firebase console details

Despite the errors the deployment is ending like half-successfully: CleanShot 2021-11-24 at 06 00 03

Legend: 1️⃣ The deployment to the *.dev.app domain never opens (i.e. failed) 2️⃣ ...while *.firebaseapp.com seems to be fully fine 3️⃣ ... and the Release History table shows record of the deployment which ended successfully

Any ideas how it can be solved? And what exactly may cause that issue?

Originally posted by @keriat in https://github.com/firebase/firebase-js-sdk/issues/1234#issuecomment-977514967