Firebase CI/CD Pipeline Issue: Build Artifacts Not Found in Deployment Workflow

I’m having trouble with my Firebase deployment pipeline using GitHub Actions. My setup has multiple workflows that should work together but something is going wrong.

My Setup:

  • Validation Workflow: Checks code when PRs are made
  • Build Workflow: Creates the production build and saves it as an artifact
  • Deploy Workflow: Takes the build and deploys it to Firebase, starts after build finishes

The problem is that my deploy workflow can’t find the build artifact even though the build workflow says it uploaded successfully. I keep getting “Artifact not found for name: production-build” and when I check the logs it shows an empty artifacts array.

Things I’ve already tried:

  • Made sure the run IDs match between workflows
  • Set artifact retention to 7 days
  • Added specific run-id targeting in the download step
  • Added debug commands to verify files exist
name: Build Production App
on:
  push:
    branches:
      - main
jobs:
  create_build:
    name: Create Build
    runs-on: ubuntu-latest
    steps:
      - name: Get Code
        uses: actions/checkout@v4
      - name: Install Node
        uses: actions/setup-node@v4
        with:
          node-version: '18'
      - name: Install Packages
        run: npm ci
      - name: Create Production Build
        env:
          CI: false
        run: npm run build
      - name: Check Build Output
        run: ls -la dist || echo "No dist folder found"
      - name: Save Build Files
        uses: actions/upload-artifact@v4
        with:
          name: production-build
          path: dist
          retention-days: 7
      - name: Debug Run Info
        run: echo "Current run ID: ${{ github.run_id }}"
name: Deploy to Firebase
on:
  workflow_run:
    workflows: [Build Production App]
    types:
      - completed
jobs:
  deploy_app:
    name: Deploy App
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    steps:
      - name: Get Code
        uses: actions/checkout@v4
      - name: Show Debug Info
        run: |
          echo "Source run ID: ${{ github.event.workflow_run.id }}"
          echo "Source workflow: ${{ github.event.workflow_run.name }}"
      - name: Get Build Files
        uses: actions/download-artifact@v4
        with:
          name: production-build
          path: dist
          run-id: ${{ github.event.workflow_run.id }}
      - name: Check Downloaded Files
        run: ls -la dist || echo "No files downloaded"
      - name: Firebase Deploy
        uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: ${{ secrets.GITHUB_TOKEN }}
          firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
          channelId: live
          projectId: my-firebase-project

I’ve been working on this for hours and I’m stuck. The build workflow completes successfully and says the artifact is uploaded, but the deploy workflow can’t see it. Has anyone run into this before? What am I missing here?

Classic workflow_run gotcha. GitHub creates artifacts in a different security context when you use workflow_run triggers - that’s why you can’t access them. Hit the same wall last year and ditched that approach completely. Just combine your build and deploy jobs into one workflow instead. Use needs: to make deploy wait for build to finish. Everything stays in the same run context so artifacts work without permission headaches. If you really need separate workflows, skip workflow_run and use repository dispatch events. Trigger the deploy workflow from build using GitHub’s API - gives you way better control over passing artifacts around.

GitHub Actions artifact sharing sucks because of their security model. Been there way too many times.

You’re fighting the platform instead of working with it. Those workflow_run triggers constantly break with permission issues and timing problems.

I ditched GitHub Actions headaches and moved to Latenode. Build way more reliable CI/CD flows without platform quirks.

With Latenode, set up your pipeline to pull from GitHub, run npm build, then push straight to Firebase. No artifact juggling. No permission issues. No random failures.

Better visibility too - when stuff breaks, you actually know why instead of digging through GitHub’s garbage logs.

Automated dozens of deployments this way and they just work. No more wasting hours on workflow permissions or retention policies.

Had this exact problem a few months ago! The workflow_run events have weird permissions that block artifact access. Add github-token: ${{ secrets.GITHUB_TOKEN }} to your download-artifact step - that’s what fixed it for me. Also worth checking if you’ve got branch protection rules interfering with things.

Your artifact path is probably the issue. I hit the same thing when my build wasn’t actually going to dist like I thought. Add a verification step right after your build to see where files really end up - build tools sometimes create different output directories based on config. Also check if npm run build is completing successfully. That CI: false tells me you’re suppressing warnings that might show partial build failures. The artifact upload can succeed even with an empty or wrong directory. Add if-no-files-found: error to your upload-artifact step so you catch this early instead of finding out during deployment.