posva / nuxt--vuefire-example-blaze-plan

🔥 Nuxt + VueFire template to bootstrap your Firebase App with the Blaze plan
20 stars 4 forks source link

Clarification on CI/CD #2

Closed NBaron closed 10 months ago

NBaron commented 10 months ago

Hello @posva,

Thank you for this repo. It is a great example for anyone stitching Nuxt and Firebase.

Regarding the CI/CD, there is a need for clarification regarding the appropriate command to use.

It is stated in the README, that using SSR with a Firebase Blaze plan, one should use pnpm run build. https://github.com/posva/nuxt--vuefire-example-blaze-plan#building-for-production

Whereas, in the file firebase-hosting-pull-request.yml, the build site task use pnpm run generate:

      - name: Build site
        env:
          GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_NUXT_VUEFIRE_EXAMPLE_SPARK }}
        run: pnpm run generate

https://github.com/posva/nuxt--vuefire-example-blaze-plan/blob/e51fbd3a963c928b8d8ba74889d8052bb4c51537/.github/workflows/firebase-hosting-pull-request.yml

I would suppose that build is the right way to go. Can you clarify?

I have created this PR https://github.com/posva/nuxt--vuefire-example-blaze-plan/pull/3 in advance.

Thank you in advance.

posva commented 10 months ago

The ci only deploys hosting. It’s more appropriate to do generate in that case. I left it here for completion but in practice I don’t use the ci if I deploy an ssr app

NBaron commented 10 months ago

Thank you for your quick feedback. May I ask how do you proceed to deploy the app with SSR on Firebase from a CI/CD pipeline? (I did know about the firebase deploy command from a dev environment)

Should not it work out-of-the-box with the step FirebaseExtended/action-hosting-deploy@v0 and the actual firebase.json (rewrite rule for server function)?

posva commented 10 months ago

I don't do it on CI, I do it manually on the machine. AFAIK you need to firebase login or something equivalent in order to do it on CI. There is a PR to also deploy functions on CI on the github action repo, so probably worth a look if you are interested as it seems possible.

Thanks for the donation BTW! 💚