From 1df7eea9e1ada796b5363f92b4ce9830f8450a21 Mon Sep 17 00:00:00 2001 From: andresmonc Date: Wed, 8 May 2024 21:29:39 -0500 Subject: [PATCH] init firebase --- .firebaserc | 5 +++ .github/workflows/firebase-hosting-merge.yml | 19 +++++++++++ .../firebase-hosting-pull-request.yml | 20 ++++++++++++ .github/workflows/main.yml | 32 ------------------- firebase.json | 16 ++++++++++ 5 files changed, 60 insertions(+), 32 deletions(-) create mode 100644 .firebaserc create mode 100644 .github/workflows/firebase-hosting-merge.yml create mode 100644 .github/workflows/firebase-hosting-pull-request.yml delete mode 100644 .github/workflows/main.yml create mode 100644 firebase.json diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 0000000..7519250 --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "israelitacticalecuador" + } +} diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml new file mode 100644 index 0000000..e6d9140 --- /dev/null +++ b/.github/workflows/firebase-hosting-merge.yml @@ -0,0 +1,19 @@ +# 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: + - master +jobs: + build_and_deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: ${{ secrets.GITHUB_TOKEN }} + firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_ISRAELITACTICALECUADOR }} + channelId: live + projectId: israelitacticalecuador diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml new file mode 100644 index 0000000..2cf47cd --- /dev/null +++ b/.github/workflows/firebase-hosting-pull-request.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 PR +on: pull_request +permissions: + checks: write + contents: read + pull-requests: write +jobs: + build_and_preview: + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: ${{ secrets.GITHUB_TOKEN }} + firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_ISRAELITACTICALECUADOR }} + projectId: israelitacticalecuador diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index c7a4656..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow will install Deno and run tests across stable and nightly builds on Windows, Ubuntu and macOS. -# For more information see: https://github.com/denolib/setup-deno - -name: Build and Deploy - -on: - push: - branches: [master] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@master - - name: Initialize Node - uses: actions/setup-node@master - - name: Install Dependencies - run: cd ./israeliTacticalUi && npm install - - name: Build - run: cd ./israeliTacticalUi && npm run build - - name: Deploy - uses: docker://w9jds/firebase-action:v11.9.0 - with: - args: deploy --only hosting - env: - FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..2c33c29 --- /dev/null +++ b/firebase.json @@ -0,0 +1,16 @@ +{ + "hosting": { + "public": "dist", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } + ] + } +}