Firebase deploy is not deploying my angular application as expected

Discussão em 'Angular' iniciado por Christian LSANGOLA, Setembro 30, 2024.

  1. I'm learning how to deploy an Angular app to Firebase using GitHub Actions, and here's my current setup:

    I have an Angular project with a project ID of myproject-99999, and within this project, I have two sites. One is called my-project-dev, which should be hosted at my-project-dev.web.app, and the other is my-project-stage, which should be hosted at my-project-stage.web.app.

    I manually deployed the my-project-dev site to my-project-dev.web.app using firebase deploy, and it worked perfectly. Here is my configuration:

    .firebaserc:

    {
    "projects": {
    "default": "myproject-99999"
    }
    }


    firebase.json:

    {
    "hosting": {
    "public": "dist/my-project-dev/browser",
    "site": "my-project-dev",
    "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
    ],
    "rewrites": [
    {
    "source": "**",
    "destination": "/index.html"
    }
    ]
    }
    }


    Now, I’ve added a GitHub Actions workflow file. Here's the configuration:

    # This file was auto-generated by the Firebase CLI
    # https://github.com/firebase/firebase-tools

    name: Deploy to Firebase Hosting on merge
    on:
    push:
    branches:
    - stage
    jobs:
    build_and_deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4

    - name: Setup Node.js
    uses: actions/setup-node@v3
    with:
    node-version: '20'

    - name: Install pnpm
    uses: pnpm/action-setup@v2
    with:
    version: 8 # Specify the pnpm version you're using

    - name: Get pnpm store directory
    shell: bash
    run: |
    echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

    - uses: actions/cache@v3
    name: Setup pnpm cache
    with:
    path: ${{ env.STORE_PATH }}
    key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
    restore-keys: |
    ${{ runner.os }}-pnpm-store-

    - name: Install dependencies
    run: pnpm install

    - name: Build
    run: pnpm build:stage

    - uses: FirebaseExtended/action-hosting-deploy@v0
    with:
    repoToken: ${{ secrets.GITHUB_TOKEN }}
    firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_MYPROJECT-999999 }}
    channelId: live
    projectId: myproject-99999
    site: my-project-stage


    When I ran the deployment, the report indicated everything went smoothly, but I don't see anything on my-project-stage.web.app where I expected it, nor on myproject-99999.web.app.

    Continue reading...

Compartilhe esta Página