From 3a1c49d1e61f5e1b02fcb53e3f925cd59348a879 Mon Sep 17 00:00:00 2001 From: Felipe Machado Date: Mon, 26 Sep 2022 09:57:37 +0900 Subject: [PATCH 1/4] Fix: Deploy config --- .github/workflows/firebase-hosting-merge.yml | 20 +++++++++++++++++++ .../firebase-hosting-pull-request.yml | 17 ++++++++++++++++ firebase.json | 11 ++++++++-- 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/firebase-hosting-merge.yml create mode 100644 .github/workflows/firebase-hosting-pull-request.yml diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml new file mode 100644 index 0000000..92b28bb --- /dev/null +++ b/.github/workflows/firebase-hosting-merge.yml @@ -0,0 +1,20 @@ +# 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: + - production +jobs: + build_and_deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm ci && npm run build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_POLYZERO_37EFC }}' + channelId: live + projectId: polyzero-37efc diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml new file mode 100644 index 0000000..216541b --- /dev/null +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -0,0 +1,17 @@ +# This file was auto-generated by the Firebase CLI +# https://github.com/firebase/firebase-tools + +name: Deploy to Firebase Hosting on PR +'on': pull_request +jobs: + build_and_preview: + if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm ci && npm run build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_POLYZERO_37EFC }}' + projectId: polyzero-37efc diff --git a/firebase.json b/firebase.json index b5f9acd..04cbb44 100644 --- a/firebase.json +++ b/firebase.json @@ -1,7 +1,11 @@ { "hosting": { "public": "build", - "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], "rewrites": [ { "source": "**", @@ -16,6 +20,9 @@ "firebase-debug.log", "firebase-debug.*.log" ], - "predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"] + "predeploy": [ + "npm --prefix \"$RESOURCE_DIR\" run lint" + ], + "source": "functions" } } From aaa1fb4d5252f8a508bccd287b0c3be24ae7725c Mon Sep 17 00:00:00 2001 From: Felipe Machado Date: Mon, 26 Sep 2022 10:03:41 +0900 Subject: [PATCH 2/4] Chore: Formating --- firebase.json | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/firebase.json b/firebase.json index 04cbb44..35eb8d7 100644 --- a/firebase.json +++ b/firebase.json @@ -1,11 +1,7 @@ { "hosting": { "public": "build", - "ignore": [ - "firebase.json", - "**/.*", - "**/node_modules/**" - ], + "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], "rewrites": [ { "source": "**", @@ -20,9 +16,7 @@ "firebase-debug.log", "firebase-debug.*.log" ], - "predeploy": [ - "npm --prefix \"$RESOURCE_DIR\" run lint" - ], + "predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"], "source": "functions" } } From ebcf671747d5a5fa49b03743c830fb43d61ad2ef Mon Sep 17 00:00:00 2001 From: Felipe Machado <73625660+felipemfm@users.noreply.github.com> Date: Mon, 26 Sep 2022 15:55:16 +0900 Subject: [PATCH 3/4] Update firebase-hosting-merge.yml --- .github/workflows/firebase-hosting-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index 92b28bb..d3c1874 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: npm ci && npm run build + - run: npm ci --legacy-peer-deps && npm run build - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: '${{ secrets.GITHUB_TOKEN }}' From 7f0dda2f5c56375099426f19f07d2be1ca703a67 Mon Sep 17 00:00:00 2001 From: Felipe Machado <73625660+felipemfm@users.noreply.github.com> Date: Mon, 26 Sep 2022 15:55:30 +0900 Subject: [PATCH 4/4] Update firebase-hosting-pull-request.yml --- .github/workflows/firebase-hosting-pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 216541b..62fb8aa 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: npm ci && npm run build + - run: npm ci --legacy-peer-deps && npm run build - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: '${{ secrets.GITHUB_TOKEN }}'