From 772fcccc7b327d61a1c07684e6b37f4e29937bd2 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Mon, 6 Dec 2021 14:26:54 +0200 Subject: [PATCH 1/4] Modified GitHub Actions workflow to deploy on push --- .github/workflows/firebase-hosting-merge.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index c9bf898..c747d06 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -1,11 +1,12 @@ # This file was auto-generated by the Firebase CLI # https://github.com/firebase/firebase-tools -name: Deploy to Firebase Hosting on merge +name: Deploy to Firebase Hosting on push 'on': push: branches: - master + - Frontend jobs: build_and_deploy: runs-on: ubuntu-latest From 2c28d5eb5c99465e099d638be0e9fecbcbe50a10 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Mon, 6 Dec 2021 14:31:59 +0200 Subject: [PATCH 2/4] Set working directory for actions --- .github/workflows/firebase-hosting-merge.yml | 5 ++++- .github/workflows/firebase-hosting-pull-request.yml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index c747d06..afad01c 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -12,9 +12,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: npm run build + - name: Build Svelte app + working-directory: ./client + run: npm run build - uses: FirebaseExtended/action-hosting-deploy@v0 with: + entryPoint: ./client repoToken: '${{ secrets.GITHUB_TOKEN }}' firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_FOXBANK_69 }}' channelId: live diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 92c7d20..871d07e 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -9,9 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: npm run build + - name: Build Svelte app + working-directory: ./client + run: npm run build - uses: FirebaseExtended/action-hosting-deploy@v0 with: + entryPoint: ./client repoToken: '${{ secrets.GITHUB_TOKEN }}' firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_FOXBANK_69 }}' projectId: foxbank-69 From 619ccc6be03f8db98bbf8425a205b76d899bf62d Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Mon, 6 Dec 2021 14:37:58 +0200 Subject: [PATCH 3/4] Configure installing dependencies with npm --- .github/workflows/firebase-hosting-merge.yml | 3 +++ .github/workflows/firebase-hosting-pull-request.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index afad01c..e62448d 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -12,6 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Install npm dependencies + working-directory: ./client + run: npm install - name: Build Svelte app working-directory: ./client run: npm run build diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 871d07e..404f944 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -9,6 +9,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Install npm dependencies + working-directory: ./client + run: npm install - name: Build Svelte app working-directory: ./client run: npm run build From ae9ea618c5975e84fc6866164034c6ba690caa35 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Mon, 6 Dec 2021 14:43:04 +0200 Subject: [PATCH 4/4] Configure to generate preview on push to Frontend --- .github/workflows/firebase-hosting-merge.yml | 1 - .github/workflows/firebase-hosting-pull-request.yml | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index e62448d..bf07d0a 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -6,7 +6,6 @@ name: Deploy to Firebase Hosting on push push: branches: - master - - Frontend jobs: build_and_deploy: runs-on: ubuntu-latest diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 404f944..6cb48b4 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -2,7 +2,14 @@ # https://github.com/firebase/firebase-tools name: Deploy to Firebase Hosting on PR -'on': pull_request +'on': + pull_request: + branches: + - master + - Frontend + push: + branches: + - Frontend jobs: build_and_preview: if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'