1

I just created my first GitHub actions workflow, however, it is not quite working as I intend. I am trying to create a CI/CD pipeline to host my React web app on Firebase whenever I push to the main branch in the repository. I would appreciate any help

.github/workflows/main.yml (Adapted from here and here)

name: FirebaseHosting

on:
  push:
    branches:
      - main

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@main
    - name: Build
      run: |
        npm install
        npm run build
    - name: Firebase Deploy
      uses: w9jds/firebase-action@master
      with:
        args: deploy --only hosting
      env:
        FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}

Errors:

Run w9jds/firebase-action@master
  with:
    args: deploy --only hosting
  env:
    FIREBASE_TOKEN: 
/usr/bin/docker run --name w9jdsfirebaseactionlatest_3bf817 --label 5588e4 --workdir /github/workspace --rm -e FIREBASE_TOKEN -e INPUT_ARGS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/Personal-Profile-2/Personal-Profile-2":"/github/workspace" w9jds/firebase-action:latest deploy --only hosting
Either FIREBASE_TOKEN or GCP_SA_KEY is required to run commands with the firebase cli

Even though my secrets are properly set in the environment secrets:

enter image description here

Ken
  • 1,155
  • 2
  • 19
  • 36

1 Answers1

2

I didn't know about environmental secrets. For example, it doesn't show up in my environment yet. In that case, how about using Secrets? The syntax (${{ secrets.FIREBASE_TOKEN }}) is correct.

enter image description here

banyan
  • 3,837
  • 2
  • 31
  • 25