LoginSignup
0
0

More than 1 year has passed since last update.

GithubActionsでfirebaseへのデプロイでfirebase-actionを使う場合と使わない場合の違い

Last updated at Posted at 2022-01-21

firebase-actionの有無を強調するためbuild部分など他stepsは省略しています。

  • firebase-action
jobs:
  build: ...
  deploy:
    name: deploy to firebase
    runs-on: ubuntu-latest
    steps:
      - name: download artifact etc
        run: ....
      - name: deploy to firebase hosting
        uses: w9jds/firebase-action@master
        with:
          args: deploy --only hosting
        env:
          FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
          PROJECT_ID: ${{ secrets.PROJECT_ID }}
  • firebaseコマンド
jobs:
  build: ...
  deploy:
    name: deploy to firebase
    runs-on: ubuntu-latest
    steps:
      - name: download artifact etc
        run: ...
      - name: deploy to firebase hosting
        run: |
          node_modules/.bin/firebase use develop --token ${{ secrets.FIREBASE_TOKEN }}
          node_modules/.bin/firebase deploy --token ${{ secrets.FIREBASE_TOKEN }} --force --only hosting
  • firebase-action

    • node_modulesのrestoreが不要
    • PROJECT_IDによる環境選択
  • firebaseコマンド

    • node_modulesのrestoreが必要
    • use の引数で環境選択
    • コマンドごとにtokenの指定が必要

結論:firebase-actionを使うのが楽。

  • 参考

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