Skip to content

use direct STT endpoint #372

use direct STT endpoint

use direct STT endpoint #372

Workflow file for this run

name: Deploy to Firebase
on:
push:
branches:
- master
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }}
FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
GCLOUD_PROJECT: ${{ secrets.GCLOUD_PROJECT }}
MAIN_KEY: ${{ secrets.MAIN_KEY }}
MONGO_URI: ${{ secrets.MONGO_URI }}
SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
SENDGRID_NEW_DEVELOPER_ACCOUNT_TEMPLATE: ${{ secrets.NEW_DEVELOPER_ACCOUNT_TEMPLATE }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
GA_API_SECRET: ${{ secrets.GA_API_SECRET }}
REDIS_HOST: ${{ secrets.REDIS_HOST }}
REDIS_URL: ${{ secrets.REDIS_URL }}
REDIS_PORT: ${{ secrets.REDIS_PORT }}
REDIS_USERNAME: ${{ secrets.REDIS_USERNAME }}
REDIS_STATUS: ${{ secrets.REDIS_STATUS }}
REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
GITHUB_STATS_TOKEN: ${{ secrets.STATS_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_REGION: ${{ secrets.AWS_REGION }}
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
STRIPE_ENDPOINT_SECRET: ${{ secrets.STRIPE_ENDPOINT_SECRET }}
NODE_ENV: production
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install Project Dependencies
run: |
rm -rf ./node_modules; npm install
npm install -g firebase-tools
- name: Install Cloud Dependencies
run: |
cd functions; rm -rf ./node_modules/; npm install; cd ..; pwd
firebase use default --token $FIREBASE_TOKEN
- name: Create .env
run: touch ./functions/.env
- name: Update .env
uses: SpicyPizza/create-envfile@v2.0
with:
envkey_ENV_VPC_CONNECTOR: ${{ secrets.VPC_CONNECTOR }}
envkey_ENV_REDIS_PORT: ${{ secrets.REDIS_PORT }}
envkey_ENV_MONGO_URI: ${{ secrets.MONGO_URI }}
envkey_ENV_REDIS_URL: ${{ secrets.REDIS_URL }}
envkey_ENV_REDIS_HOST: ${{ secrets.REDIS_HOST }}
envkey_ENV_CLIENT_TEST: false
envkey_ENV_REDIS_USERNAME: ${{ secrets.REDIS_USERNAME }}
envkey_ENV_FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }}
envkey_ENV_FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
envkey_ENV_REDIS_STATUS: true
envkey_ENV_REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
envkey_ENV_MAIN_KEY: ${{ secrets.MAIN_KEY }}
envkey_ENV_REPLICA_SET: true
envkey_ANALYTICS_GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
envkey_ANALYTICS_GA_API_SECRET: ${{ secrets.GA_API_SECRET }}
envkey_SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
envkey_SENDGRID_NEW_DEVELOPER_ACCOUNT_TEMPLATE: ${{ secrets.NEW_DEVELOPER_ACCOUNT_TEMPLATE }}
envkey_GITHUB_STATS_TOKEN: ${{ secrets.STATS_TOKEN }}
envkey_AWS_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
envkey_AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }}
envkey_AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
envkey_AWS_REGION: ${{ secrets.AWS_REGION }}
envkey_RUNTIME_ENV: "production"
envkey_STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
envkey_STRIPE_ENDPOINT_SECRET: ${{ secrets.STRIPE_ENDPOINT_SECRET }}
envkey_ENV_IGBO_STT_URL: ${{ secrets.ENV_IGBO_STT_URL }}
envkey_ENV_IGBO_TO_ENGLISH_URL: ${{ secrets.ENV_IGBO_TO_ENGLISH_URL }}
envkey_ENV_ENGLISH_TO_IGBO_URL: ${{ secrets.ENV_ENGLISH_TO_IGBO_URL }}
directory: functions
- name: Build Production Project
run: |
firebase functions:config:set runtime.env=production --token $FIREBASE_TOKEN
npm run build
- name: Migrate MongoDB Data
run: |
firebase functions:config:set env.redis_status=true runtime.env=production --token $FIREBASE_TOKEN
npm run migrate-up
- name: Deploy Production Firebase Functions
run: |
firebase deploy --project=igbo-api-bb22d --only functions
- name: Deploy Production Firebase Hosting
run: |
firebase deploy --project=igbo-api-bb22d --only hosting
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
- name: Delete .env
run: rm -rf ./functions/.env