diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 00000000..695ab1fd --- /dev/null +++ b/.firebaserc @@ -0,0 +1,22 @@ +{ + "projects": { + "default": "hotwax-digital-commerce", + "production": "digital-commerce-71eb8" + }, + "targets": { + "hotwax-digital-commerce": { + "hosting": { + "dev-inventorycount": [ + "dev-inventorycount" + ] + } + }, + "digital-commerce-71eb8": { + "hosting": { + "inventorycount": [ + "inventorycount" + ] + } + } + } +} diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml new file mode 100644 index 00000000..85916f08 --- /dev/null +++ b/.github/workflows/firebase-hosting-merge.yml @@ -0,0 +1,29 @@ +# 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@v2 + - name: Install Dependencies + run: npm install + - name: Generate .env file + run: cp .env.example .env + - name: Build + run: npm run build + - name: Install Firebase + run: npm install -g firebase-tools + - name: Set Firebase project + run: firebase use default --token "$HOTWAX_PUBLIC_SECRET" + env: + HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }} + - name: Deploy + run: firebase deploy --token "$HOTWAX_PUBLIC_SECRET" -m "Deploying via GitHub actions" --only hosting:dev-inventorycount + env: + HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }} diff --git a/changelogs/unreleased/-20d6xcu.yml b/changelogs/unreleased/-20d6xcu.yml new file mode 100644 index 00000000..6dcf8431 --- /dev/null +++ b/changelogs/unreleased/-20d6xcu.yml @@ -0,0 +1,6 @@ +--- +title: Added firebase auto deployment configuration +ticket_id: "#20d6xcu" +merge_request: 60 +author: Disha +type: added diff --git a/firebase.json b/firebase.json new file mode 100644 index 00000000..2284197c --- /dev/null +++ b/firebase.json @@ -0,0 +1,32 @@ +{ + "hosting": [ + { + "target": "inventorycount", + "public": "dist", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "rewrites": [ { + "source": "**", + "destination": "/index.html" + } ] + + }, + { + "target": "dev-inventorycount", + "public": "dist", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "rewrites": [ { + "source": "**", + "destination": "/index.html" + } ] + + } + ] +}