From 8df162bbae3aab65c8518e537800ce64318c09c0 Mon Sep 17 00:00:00 2001 From: Ranjith Date: Wed, 24 Jan 2024 15:26:10 +0530 Subject: [PATCH] Add environments --- .env.dev | 0 .firebase/hosting.cHVibGlj.cache | 1 + .firebaserc | 5 +++++ .github/workflows/firebase-hosting-merge.yml | 20 +++++++++++++++++++ .../firebase-hosting-pull-request.yml | 17 ++++++++++++++++ firebase.json | 16 +++++++++++++++ 6 files changed, 59 insertions(+) create mode 100644 .env.dev create mode 100644 .firebase/hosting.cHVibGlj.cache create mode 100644 .firebaserc create mode 100644 .github/workflows/firebase-hosting-merge.yml create mode 100644 .github/workflows/firebase-hosting-pull-request.yml create mode 100644 firebase.json diff --git a/.env.dev b/.env.dev new file mode 100644 index 0000000..e69de29 diff --git a/.firebase/hosting.cHVibGlj.cache b/.firebase/hosting.cHVibGlj.cache new file mode 100644 index 0000000..e30aee5 --- /dev/null +++ b/.firebase/hosting.cHVibGlj.cache @@ -0,0 +1 @@ +index.html,1690600409468,00519993ca464cfad4694ffd7b8572508be384d9a496f10deeda88729303b2b2 diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 0000000..0877fe3 --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "car-rental-3a89c" + } +} diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml new file mode 100644 index 0000000..b3b6223 --- /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: + - main +jobs: + build_and_deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: npm ci && npm run build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CAR_RENTAL_3A89C }}' + channelId: live + projectId: car-rental-3a89c diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml new file mode 100644 index 0000000..3d77c85 --- /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@v4 + - run: npm ci && npm run build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CAR_RENTAL_3A89C }}' + projectId: car-rental-3a89c diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..93fb369 --- /dev/null +++ b/firebase.json @@ -0,0 +1,16 @@ +{ + "hosting": { + "public": "public", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } + ] + } +}