Migrate GitHub workflow to adapt firebase-tools v13
March 25, 2025
I updated firebase-tools. It looked like the way to use webframeworks changed.
I edited .github/workflows/firebase-hosting-merge.yml like this. (.github/workflows/firebase-hosting-pull-request.yml can be fixed likewise)
# 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:
      - main
jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - run: cd hosting && npm ci
      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: "${{ secrets.GITHUB_TOKEN }}"
          firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_YSN_BLOG }}"
          channelId: live
          projectId: ysn-blog
        env:
          FIREBASE_CLI_EXPERIMENTS: webframeworks
We used to specify webframeworks as command option.
# outdated way
npx firebase experiments:enable webframeworks
But it was moved to env.
In addition to that, I needed to add some roles to the IAM account for GitHub.
- Firebase Extensions Developer
 - Artifact Registry Writer
 
That's it.