Deploying Angular App to Firebase Hosting Github Actions

Discussão em 'Angular' iniciado por Gabe, Fevereiro 25, 2025.

  1. Gabe

    Gabe Guest

    I'm trying to use Github actions to deploy my Angular app to Firebase hosting. I'm using this action in order to accomplish this. My release.yml file looks like the following:

    name: Release
    on:
    push:
    branches:
    - master

    jobs:
    firebase-deploy:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@master
    - uses: actions/setup-node@master
    with:
    node-version: '14.x'
    - run: npm install
    - run: npm run build --prod
    - uses: w9jds/firebase-action@master
    with:
    args: deploy --only hosting
    env:
    FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}



    However when I commit this onto the master branch, I get the following error:


    Error: Must supply either "site" or "target" in each "hosting" config.
    ​

    I have no clue what this error means, so any help would be great. Thanks!


    Edit: My firebase.json looks like the following:

    {
    "hosting": [
    {
    "public": "MyName",
    "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
    ],
    "rewrites": [
    {
    "source": "**",
    "destination": "/index.html"
    }
    ]
    },
    {
    "target": "projectName",
    "public": "dist/projectName",
    "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
    ],
    "rewrites": [
    {
    "source": "**",
    "destination": "/index.html"
    }
    ]
    }
    ]
    }

    Continue reading...

Compartilhe esta Página