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?