diff --git a/.github/workflows/client-deploy-on-merge.yml b/.github/workflows/deploy-on-merge.yml similarity index 59% rename from .github/workflows/client-deploy-on-merge.yml rename to .github/workflows/deploy-on-merge.yml index caa636a..8bbbcb2 100644 --- a/.github/workflows/client-deploy-on-merge.yml +++ b/.github/workflows/deploy-on-merge.yml @@ -21,3 +21,22 @@ jobs: firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_POOLSCORE_1973 }}' channelId: live projectId: poolscore-1973 + + firestore_deploy: + runs-on: ubuntu-latest + env: + working-directory: ./firestore + steps: + - uses: actions/checkout@v3 + - run: npm deploy + working-directory: ${{env.working-directory}} + + function_deploy: + runs-on: ubuntu-latest + env: + working-directory: ./functions + steps: + - uses: actions/checkout@v3 + - run: npm ci && npm run build + working-directory: ${{env.working-directory}} + - run: npm deploy diff --git a/firestore/package.json b/firestore/package.json index 9472568..e71040a 100644 --- a/firestore/package.json +++ b/firestore/package.json @@ -6,6 +6,7 @@ "author": "", "license": "ISC", "scripts": { + "deploy": "npx firebase-tools deploy --only firestore:rules", "test": "npx firebase-tools emulators:exec --only firestore test/run.sh", "export": "npx firebase-tools emulators:export ./emulator_data", "lint": "eslint test/" diff --git a/functions/package.json b/functions/package.json index 9725e06..ec3609c 100644 --- a/functions/package.json +++ b/functions/package.json @@ -10,7 +10,7 @@ "build": "tsc", "build:watch": "tsc --watch", "predeploy": "npm run build", - "deploy": "npx firebase-tools deploy --only functions", + "deploy": "npx firebase-tools deploy --force --only functions", "pretest": "npm run build", "test": "npx firebase-tools emulators:exec --only 'functions,firestore,auth' 'npx jest'", "test:watch": "concurrently --kill-others \"npm:build:watch\" \"npx firebase-tools emulators:exec 'npx jest --watch'\""