fix(routes): fix logic for determine routes and stop checking TS duri… #320
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v2 | |
- name: Setup Node | |
uses: actions/[email protected] | |
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: Migrate MongoDB Data | |
run: | | |
firebase functions:config:set env.redis_status=true runtime.env=production --token $FIREBASE_TOKEN | |
npm run migrate-up | |
- name: Create .env | |
run: touch ./functions/.env | |
- name: Update .env | |
uses: SpicyPizza/[email protected] | |
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 }} | |
directory: functions | |
- name: Build Production Project | |
run: | | |
firebase functions:config:set runtime.env=production --token $FIREBASE_TOKEN | |
npm run build | |
- 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 |