0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

pnpmで管理しているプロジェクトをfirebase hostingにデプロイする時のgithub Workflow file

Last updated at Posted at 2025-02-27

Github workflowの環境にはデフォルトでpnpmが入っていないため、firebase hostingの設定中に、CLIに聞かれるままbuildスクリプトでpnpm buildを指定するとコケるので、workflow fileを書き換えてやる必要がある。

参考↓

上記を参考にautogeneratedのworkflowファイルと組み合わせたものが以下


name: Deploy to Firebase Hosting on merge
on:
  push:
    branches:
      - main
jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [20]
    steps:
      - uses: actions/checkout@v4
      - name: Install pnpm
        uses: pnpm/action-setup@v4
        with:
          version: 10
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
          cache: "pnpm"
      - name: Install dependencies
        run: pnpm install
      - name: Build
        run: pnpm build
      - uses: FirebaseExtended/action-hosting-deploy@v0
        with:
          repoToken: ${{ secrets.GITHUB_TOKEN }}
          firebaseServiceAccount: ${{ secrets.xxxxxxxxxxxx }}
          channelId: live
          projectId: some-project-id

今んとこはこれでうまく行ってます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?